Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
React Native docs
LayoutReact Native

Screen

Scaffold a themed React Native screen with safe areas, keyboard avoidance, refresh, and pinned slots.

Public APILumenScreenReact Native

Native example

Use Screen

Use as the root of a React Native screen. Pass insets from the application safe-area provider, keep refresh state in the application, and set scroll={false} when the body is already a virtualized list.

Screen rendered in the Expo web renderer Lumen playground

Captured exampleExpo web renderer

Open interactive preview
Open the Screen demo
tsx
<LumenScreen
  footer={<LumenButton onPress={save}>Save</LumenButton>}
  header={<LumenText variant="title">Projects</LumenText>}
  refreshAccessibilityLabel="Refresh projects"
  refreshing={refreshing}
  safeAreaInsets={insets}
  onRefresh={refreshProjects}
>
  {content}
</LumenScreen>

Reference

Public API

The primary shared and platform-specific options exposed by LumenScreen.

APIValues or typeDefaultDescription
safeAreaInsetsLumenSafeAreaInsets{}Keeps the header, body, and footer clear of system bars and the home indicator.
scrollbooleantrueScrolls the body between the pinned header and footer.
maxContentWidthnumber · null720Centers content at a readable width on tablets; null uses the full width.
refreshing / onRefreshboolean · () => voidundefinedAdds a Lumen pull-to-refresh indicator to the scrolling body.
header / footerReactNodeundefinedPins content above and below the body.
avoidKeyboardbooleantrueKeeps focused fields and the footer above the software keyboard.

Native behavior

Design and accessibility

When to use it

Use as the root of a React Native screen. Pass insets from the application safe-area provider, keep refresh state in the application, and set scroll={false} when the body is already a virtualized list.

Accessibility

Header and footer stay outside the scroll region, content stays clear of system bars and the software keyboard, and native scroll and refresh semantics are preserved.

React Native docsNative primitives