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 | undefinedPer-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) | undefinedCalled 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) | undefinedCalled when the resting snap-point index changes.
openedboolean | undefinedControlled open state.
overlayPropsOverlayProps | undefinedProps forwarded to the underlying `Overlay` scrim.
positionnumber | undefinedControlled 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> | undefinedPer-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.

SlotUsage
footerstyles={{ footer: { … } }}
handlestyles={{ handle: { … } }}
headerstyles={{ header: { … } }}
overlaystyles={{ overlay: { … } }}
rootstyles={{ root: { … } }}
Accessibility & DOM props (2)
PropType
keyKey | null | undefined
refRef<SheetRef> | undefined