Mobile › Lists and layout
Screen
The frame of every page: safe areas, scrolling, a header bar, a footer and pull to refresh.
Installation
npx expo install plankui-mobile react-native-safe-area-context expo-hapticsUsage
import { Screen, NavBar } from "plankui-mobile";
<Screen
header={<NavBar title="Settings" variant="large" />}
footer={<Button block size="lg" onPress={save}>Save</Button>}
grouped
refreshing={refreshing}
onRefresh={reload}
>
{/* content */}
</Screen>iOS and Android
iOS: Content scrolls under the bar; a large title shrinks into it.
Android: The top bar lifts with a tint once content scrolls under it.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | The content. | |
| header | ReactNode | – | A NavBar. It handles the top safe area; without one the screen does. |
| footer | ReactNode | – | Pinned below the content, such as a TabBar or a bottom action. |
| scroll | boolean | true | false for screens that manage their own list, such as a FlatList. |
| grouped | boolean | false | Grey grouped background on iOS, for ListSection screens. |
| onRefresh | () => void | – | Turns on pull to refresh. |
| refreshing | boolean | false | Shows the refresh spinner. |
| padded | boolean | true | 16 pt padding around the content. |
| contentStyle | StyleProp<ViewStyle> | – | Style for the scroll content. |