suiss/ui · Component
Keyboard Scroll View
A scroll view that keeps the focused text field visible above the on-screen keyboard.
Keyboard Scroll View 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.

KeyboardScrollView wraps the React Native ScrollView. When the keyboard opens, it measures how much of the view the keyboard covers, adds matching space at the end of the content and scroll indicator, and scrolls just enough to bring the focused input above the keyboard.
Use it for forms and other screens with text fields that would otherwise end up behind the keyboard.
Installation
- Install the following dependencies:
- Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/keyboard-scroll-view.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
- Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/keyboard-scroll-view.tsx:
- Update the import paths to match your project setup.
- Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/keyboard-scroll-view.tsx:
- Update the import paths to match your project setup.
-
Target iOS 17 or later.
-
Copy the theme files every view uses:
- Copy the source:
- 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
Larger bottom offset
Set bottomOffset to 64 to keep the focused field 64 points above the keyboard.

Focused
The last field is focused on mount and scrolled into view.

With bottom bar
A form above a bottom bar with a full-width button.

The React Native tab shows 1 more example.
The React Native tab shows 1 more example.
Accessibility
- The view is a standard
ScrollView, so screen reader scrolling works as usual.
API Reference
KeyboardScrollView
| Prop | Type | Default |
|---|---|---|
bottomOffset | number | 16 |
Also accepts the props of ScrollViewProps, React.RefAttributes<ScrollView>.
Place inputs anywhere inside the view; no extra setup is needed. bottomOffset is the space kept between the focused input and the keyboard. Only an input inside the visible frame of the scroll view is adjusted; inputs scrolled out of view are left alone. After a touch while the keyboard is open, the view checks the focused input again after a short delay.
All ScrollView props are passed through. By default taps on the content are handled while the keyboard is open (keyboardShouldPersistTaps="handled"), and keyboardDismissMode is interactive on iOS and on-drag on Android. The view fills its parent with flex-1.
KeyboardScrollViewContext exposes scrollToFocused, which children can call to bring the focused input into view again, for example after their layout changes.
KeyboardScrollView
| Parameter | Type | Default |
|---|---|---|
showsIndicators | Bool | true |
content | () -> Content | - |
KeyboardScrollView
| Parameter | Type | Default |
|---|---|---|
modifier | Modifier | Modifier |
state | ScrollState | rememberScrollState() |
contentPadding | PaddingValues | PaddingValues(0.dp) |
verticalArrangement | Arrangement.Vertical | Arrangement.Top |
content | @Composable ColumnScope.() -> Unit | - |



