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-haptics

Usage

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

PropTypeDefaultDescription
childrenReactNodeThe content.
headerReactNode–A NavBar. It handles the top safe area; without one the screen does.
footerReactNode–Pinned below the content, such as a TabBar or a bottom action.
scrollbooleantruefalse for screens that manage their own list, such as a FlatList.
groupedbooleanfalseGrey grouped background on iOS, for ListSection screens.
onRefresh() => void–Turns on pull to refresh.
refreshingbooleanfalseShows the refresh spinner.
paddedbooleantrue16 pt padding around the content.
contentStyleStyleProp<ViewStyle>–Style for the scroll content.