Knit UI
GitHub

Sheet is the kit's bottom surface. It handles dialogs that hug their content, long lists with a pinned footer, forms that ride above the keyboard, and persistent panels over a map.

Snap points or content fit

Pass snapPoints as percentages of the screen, or snapPoints="fit" to hug the content up to maxHeight. An open panel re-settles on its own when the snap points or its content change. The content region ends at the resting snap, so Sheet.Footer stays on screen at every one.

Scrolling

Put anything that scrolls in Sheet.ScrollView or Sheet.FlatList, or pass renderSheetScrollComponent as another virtualized list's renderScrollComponent. These hand one finger between the list and the panel. A plain React Native ScrollView knows nothing about the sheet, and on Android the panel's drag stops it from scrolling.

Keyboard

moveOnKeyboardChange rides the whole panel above the soft keyboard, footer included, tracking it frame by frame while the scroller shrinks to fit. It defaults to the value of modal, so a persistent sheet stays where it is.

Persistent sheets

With modal={false} and withOverlay={false}, the sheet is a panel beside the page, and the page behind it keeps every touch. Controlled position and several snap points work as they do in a modal sheet.

Accessibility

title names the panel and adds a close button, which closeButtonProps can rename. With one snap point the handle is a drawn grabber, not a control. Escape and Android back close the topmost modal sheet first, and the spring honours reduced motion on every platform.

Playground

Loading playground…

Playground
<Sheet />

Examples

Default

The default two-snap sheet ([80, 10]) with a handle.

Loading example…

DefaultSourceStorybook

Snap Points

Three snap points; dismissible by flinging past the lowest.

Loading example…

Snap PointsSourceStorybook

Custom Handle

A custom handle via the Sheet.Handle marker.

Loading example…

Custom HandleSourceStorybook

With Scroll View

Scrollable content inside the panel via Sheet.ScrollView, exercising the scroll↔drag handoff (native): at the top snap the list scrolls; drag it back to the top and keep pulling down and the sheet takes over (collapses to 40 %, then dismisses). From the 40 % snap a drag moves the sheet, not the list.

Loading example…

With Scroll ViewSourceStorybook

With Header And Footer

A fixed header + footer via the Sheet.Header / Sheet.Footer markers. Both stay pinned (below the handle / above the bottom edge) while the Sheet.ScrollView between them scrolls independently — the scroll region is squeezed between the two fixed bars.

Loading example…

With Header And FooterSourceStorybook

Sizes

Top-corner rounding scale.

Loading example…

SizesSourceStorybook

Controlled Only

Non-dismissible (no overlay press / snap-to-bottom); close via a button.

Loading example…

Controlled OnlySourceStorybook

Fit Content

snapPoints="fit" hugs the content, and follows it when it changes height.

Loading example…

Fit ContentSourceStorybook

Fit With Max Height

A long list stops at maxHeight and scrolls above the pinned footer.

Loading example…

Fit With Max HeightSourceStorybook

Pinned Footer

The footer sits on the panel's visible bottom edge at every snap.

Loading example…

Pinned FooterSourceStorybook

Changing Snap Points

New snap points move an open panel without a snapTo call.

Loading example…

Changing Snap PointsSourceStorybook

With Keyboard

The whole panel rides above the keyboard (native), and the list shrinks to fit.

Loading example…

With KeyboardSourceStorybook

Persistent

A persistent sheet leaves the page behind it free to take touches.

Loading example…

PersistentSourceStorybook

Virtualized List

Sheet.FlatList gives a virtualized list the same scroll handoff.

Loading example…

Virtualized ListSourceStorybook

Centred On Wide Screens

maxWidth centres the panel on tablets and wide windows.

Loading example…

Centred On Wide ScreensSourceStorybook

Stacked

Two modal sheets: Escape and Android back close the topmost first.

Loading example…

StackedSourceStorybook

Styles

Per-slot styles overrides (root / overlay / handle).

Loading example…

StylesSourceStorybook

Props

PropTypeDefaultDescription
animationConfigSpringConfig | undefined—Per-instance spring override (passed to reanimated `withSpring`).
aria-labelstring | undefined—Accessible name of the panel. On web it is set on the element that carries the role (the dialog, or the region of a non-modal sheet); on native it becomes the panel's `accessibilityLabel`. Takes precedence over `title`.
aria-labelledbystring | undefined—Id of the element that names the panel (typically its visible title), set on the element that carries the role. Web only; takes precedence over `aria-label` for assistive tech.
bottomInsetnumber | undefined—Space kept clear under the content or footer. Defaults to the bottom safe area on native (from `react-native-safe-area-context`) and to `env(safe-area-inset-bottom)` on web. Pass `0` to opt out.
childrenReactNode—`Sheet.Overlay` / `Sheet.Handle` / `Sheet.Header` / `Sheet.Footer` / `Sheet.Frame` markers, or plain content (which folds into the panel).
closeButtonProps{ "aria-label"?: string; } | undefined{ "aria-label": "Close" }Close button props. Set `aria-label` to name it.
closeOnBackPressboolean | undefinedtrueAndroid hardware back closes a modal sheet, topmost first.
closeOnBrowserBackboolean | undefinedfalseWeb: the browser's Back button (or back gesture) closes the open sheet, as Android's hardware back does. The sheet adds one history entry while open, without changing the URL, and removes it when it closes any other way. Off by default because it touches the page's history. No effect on native.
closeOnEscapeboolean | undefinedtrueEscape closes the sheet (web), topmost modal sheet first.
defaultOpenedboolean | undefinedfalseUncontrolled initial open state on mount.
defaultPositionnumber | undefined0 (most open)Uncontrolled initial snap-point index.
disableDragboolean | undefinedfalseDisable all drag handling.
disableRemoveScrollboolean | undefinedfalseOpt out of locking body scroll while a modal sheet is open (web).
dismissOnOverlayPressboolean | undefinedtrueTapping the scrim closes the sheet. A tap within the first moments after opening is ignored, so the second tap of a double tap on the opener can't close it again.
dismissOnSnapToBottomboolean | undefinedfalseDragging past the lowest snap closes the sheet.
maxHeightnumber | `${number}%` | undefined—The tallest a `snapPoints="fit"` panel may grow: px, or a `"NN%"` share of the screen. Defaults to the screen below the top safe area.
maxWidthnumber | undefined—Cap the panel's width and centre it, for tablets and wide windows.
modalboolean | undefinedtrueA modal sheet is teleported to the app root and exposed as a dialog (`role="dialog"` + `aria-modal="true"` on web, `accessibilityViewIsModal` on native). A non-modal sheet renders inline as a persistent panel: not a dialog, but a `role="region"` landmark when it has an accessible name (`aria-label` / `aria-labelledby`), and no role without one.
moveOnKeyboardChangeboolean | undefinedthe value of `modal`Ride the whole panel, footer included, above the soft keyboard, tracking it while the scrollable content shrinks to fit. Native tracks it frame by frame; mobile web follows the browser's visual viewport.
onClose(() => void) | undefined—Called whenever the sheet requests to close — overlay press, drag-to-dismiss, Escape, snap-to-bottom, or the imperative `close()`. Fires after the close animation in uncontrolled mode; immediately in controlled mode.
onPositionChange((position: number) => void) | undefined—Called when the resting snap-point index changes.
openedboolean | undefined—Controlled open state.
overlayPropsOverlayProps | undefined—Props forwarded to the underlying `Overlay` scrim.
paddedboolean | undefinedfalsePad the content region with the kit's standard gutter.
positionnumber | undefined—Controlled snap-point index (into `snapPoints`).
returnFocusboolean | undefinedtrueReturn focus to the previously-focused element on close (web).
size systemSheetSize | undefined"lg"Top-corner rounding scale.
snapPointsnumber[] | "fit" | undefined[80, 10]Snap points as % of the screen the sheet occupies, ordered most-visible → least-visible, or `"fit"` for one snap that hugs the panel's content. A fit panel measures the handle, header, content and footer, follows content that changes height while open, and stops at {@link SheetProps.maxHeight}, where a `Sheet.ScrollView` starts to scroll.
stylevoid | StylePiece | Falsy | (Readonly<Omit<Readonly<Omit<Readonly<{ display?: "none" | "flex" | "contents" | undefined; width?: DimensionValue | undefined; height?: DimensionValue | undefined; bottom?: DimensionValue | undefined; end?: Dime…—Inline style on the panel surface.
styles systemSlotStyles<SheetStyles> | undefined—Per-slot style overrides. See {@link SheetStyles}.
testIDstring | undefined——
titleReactNode—Title shown in the header. Also names the panel for assistive tech.
trapFocusboolean | undefinedtrueTrap keyboard focus within the panel while open (web).
withCloseButtonboolean | undefined`true` when `title` is setShow a close button in the header.
withHandleboolean | undefinedtrueShow the default drag handle when no `Sheet.Handle` is provided.
withOverlayboolean | undefinedtrueRender the scrim behind the panel.
zIndexnumber | undefined200Root stack order.

Style slots

Every part of Sheet can be styled through the styles prop. Explicit props on the component always win over slot styles.

SlotTargets
bodyThe content region between header and footer.
closeButtonThe close button.
footerThe fixed footer region (Sheet.Footer).
handleThe drag handle bar (Sheet.Handle).
headerThe fixed header region (Sheet.Header).
overlayThe scrim (Sheet.Overlay).
rootThe panel surface (Sheet.Frame).
titleThe title.
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<SheetRef> | undefined

Edit this page on GitHub