suiss/ui · Component
Input Accessory Bar
A toolbar above the keyboard with previous, next and done buttons for moving through form fields.
Input Accessory Bar is an open-source component from suiss/ui for React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.

InputAccessoryBar connects a set of inputs and shows a bar above the keyboard while one of them is focused. The up and down arrows move focus to the previous or next input, and the done button dismisses the keyboard.
On iOS the bar is a native InputAccessoryView, attached to the keyboard. On Android it is rendered through a portal and positioned just above the keyboard while an input is focused.
Installation
The CLI also adds what it builds on: Button, Icon, Input, Keyboard Scroll View, Text.
- Install the following dependencies:
-
Add the pieces it builds on: Button, Icon, Input, Keyboard Scroll View, Text.
-
Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/input-accessory-bar.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Button, Icon, Input, Keyboard Scroll View, Text.
-
Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/input-accessory-bar.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Add the pieces it builds on: Button, Icon, Input, Keyboard Scroll View, Text.
-
Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/input-accessory-bar.tsx:
- Update the import paths to match your project setup.
-
Target iOS 17 or later.
-
Add the Swift package to your app:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Add the files to your app target.
- Apply the Compose compiler plugin, enable Compose, set
compileSdkto 37 or higher andminSdkto 24 or higher, and add the dependencies:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Update the
com.esuiss.uipackage names to match your project.
Usage
Examples
Focused
The first input focused, so the bar is visible.

Custom labels
Use previousLabel, nextLabel and doneLabel to localize the buttons, and onDone to react when done is pressed.

With textarea
For other text inputs, such as a Textarea, call useInputAccessoryBarInput() and spread the returned props onto the input.

Accessibility
- The arrow buttons are labelled with
previousLabelandnextLabeland are disabled at the first and last input. - The done button is a text button that dismisses the keyboard.
API Reference
InputAccessoryBar
Provider that tracks the inputs and renders the bar.
| Prop | Type | Default |
|---|---|---|
previousLabel | string | "Previous" |
nextLabel | string | "Next" |
doneLabel | React.ReactNode | "Done" |
onDone | () => void | - |
portalHost | string | - |
className | string | - |
children | React.ReactNode | - |
Wrap the form in InputAccessoryBar. doneLabel can be text or a node, and onDone is called after the keyboard is dismissed. portalHost names the portal host the bar renders into on Android, where the bar also reserves its height so keyboard-aware layouts stay above it. Inside a Keyboard Scroll View, the focused input is scrolled into view.
InputAccessoryBarInput
Input connected to the bar.
| Prop | Type | Default |
|---|---|---|
order | number | - |
Also accepts the props of React.ComponentProps<typeof Input>.
Use it in place of Input. order sets its position in the previous and next order; without it, inputs follow the order they mount. The return key reads "next" on every input but the last, which reads "done" and dismisses the keyboard.
InputAccessoryBar
Provider that tracks the inputs and renders the bar.
| Parameter | Type | Default |
|---|---|---|
previousLabel | LocalizedStringKey | "Previous" |
nextLabel | LocalizedStringKey | "Next" |
doneLabel | LocalizedStringKey | "Done" |
onPrevious | (() -> Void)? | nil |
onNext | (() -> Void)? | nil |
onDone | () -> Void | - |
.inputAccessoryBar
| Parameter | Type | Default |
|---|---|---|
focus | FocusState<Value?>.Binding | - |
order | [Value] | - |
previousLabel | LocalizedStringKey | "Previous" |
nextLabel | LocalizedStringKey | "Next" |
doneLabel | LocalizedStringKey | "Done" |
InputAccessoryState
Takes no parameters.
| Property | Type |
|---|---|
hasPrevious | Boolean |
hasNext | Boolean |
InputAccessoryState.previous
Takes no parameters.
InputAccessoryState.next
Takes no parameters.
rememberInputAccessoryState
Takes no parameters.
Returns InputAccessoryState.
Modifier.inputAccessory
| Parameter | Type | Default |
|---|---|---|
state | InputAccessoryState | - |
index | Int | - |
Returns Modifier.
InputAccessoryBar
Provider that tracks the inputs and renders the bar.
| Parameter | Type | Default |
|---|---|---|
state | InputAccessoryState | - |
modifier | Modifier | Modifier |
previousLabel | String | "Previous" |
nextLabel | String | "Next" |
doneLabel | String | "Done" |
onDone | (() -> Unit)? | null |



