Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
React Native docs
NavigationReact Native

Adaptive modal

Present a bottom sheet on compact windows and a centered dialog from 768 points.

Public APILumenAdaptiveModalReact Native

Native example

Use Adaptive modal

Use for short tasks that need confirmation on every window size. Use LumenAlertDialog for a confirmation without content and LumenSheet for sheet-only presentation.

Adaptive modal rendered in the Expo web renderer Lumen playground

Captured exampleExpo web renderer

Open interactive preview
Open the Adaptive modal demo
tsx
<LumenAdaptiveModal
  confirmLabel="Rename"
  confirmLoading={saving}
  onConfirm={renameProject}
  onDismiss={() => setRenaming(false)}
  safeAreaInsets={insets}
  title="Rename project"
  visible={renaming}
>
  <LumenTextField accessibilityLabel="Project name" value={name} onChangeText={setName} />
</LumenAdaptiveModal>

Reference

Public API

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

APIValues or typeDefaultDescription
titlestringRequiredNames the modal and receives focus when it opens.
visible / onDismissboolean · () => voidRequiredControls presentation and handles cancel, backdrop, back, and Escape requests.
confirmLabel / onConfirmstring · () => voidundefinedAdds a primary or destructive confirm action beside cancel.
confirmLoadingbooleanfalseShows progress and blocks dismissal until the work settles.
destructivebooleanfalseUses danger styling for the confirm action.
avoidKeyboardbooleantrueKeeps editable content above the software keyboard.

Native behavior

Design and accessibility

When to use it

Use for short tasks that need confirmation on every window size. Use LumenAlertDialog for a confirmation without content and LumenSheet for sheet-only presentation.

Accessibility

The modal contains focus, is named by its heading, moves focus to the heading on open, and closes through the platform back or Escape request unless dismissal is blocked.

React Native docsNative primitives