Knit UI
GitHub

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

Styles

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

Loading example…

StylesSourceStorybook

Controlled Only

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

Loading example…

Controlled OnlySourceStorybook

Props

PropTypeDefaultDescription
animationConfigSpringConfig | undefined—Per-instance spring override (passed to reanimated `withSpring`).
childrenReactNode—`Sheet.Overlay` / `Sheet.Handle` / `Sheet.Header` / `Sheet.Footer` / `Sheet.Frame` markers, or plain content (which folds into the panel).
closeOnEscapeboolean | undefinedtrueEscape closes the sheet (web).
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 open (web).
dismissOnOverlayPressboolean | undefinedtrueTapping the scrim closes the sheet.
dismissOnSnapToBottomboolean | undefinedfalseDragging past the lowest snap closes the sheet.
modalboolean | undefinedtrueRender into the app root (teleported) vs. inline.
moveOnKeyboardChangeboolean | undefinedfalseLift the panel above the soft keyboard (native).
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.
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[] | undefined[80, 10]Snap points as % of the screen the sheet occupies, ordered most-visible → least-visible.
styleFalsy | (ViewStyle | CSSProperties | (CSSProperties & ViewStyle)) | RegisteredStyle<ViewStyle | CSSProperties | (CSSProperties & ViewStyle)> | RecursiveArray<Falsy | (ViewStyle | CSSProperties | (CSSProperties & ViewStyle)) | RegisteredStyl…—Inline style on the panel surface.
styles systemSlotStyles<SheetStyles> | undefined—Per-slot style overrides (`root` / `overlay` / `handle`).
testIDstring | undefined——
trapFocusboolean | undefinedtrueTrap keyboard focus within the panel while open (web).
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
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).
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<SheetRef> | undefined

Edit this page on GitHub