API Reference

Complete reference of all components, props, and types.

BottomSheet.Root

The root provider. All other components must be nested inside it.

PropTypeDefaultDescription
openbooleanControlled open state
defaultOpenbooleanfalseUncontrolled initial state
onOpenChange(open: boolean) => voidCalled when state changes
snapPoints(number | string)[]Snap positions
activeSnapPointnumber | string | nullControlled snap point
onActiveSnapPointChange(snap) => voidCalled on snap change
snapToSequentialPointbooleanfalseStep-by-step snapping
fadeFromIndexnumberlastOverlay fade start index
modalbooleantrueEnable overlay + focus trap
dismissiblebooleantrueAllow drag/ESC/overlay close
handleOnlybooleanfalseDrag only from Handle
floatingbooleanfalseFloating detached mode
progressiveOverlaybooleanfalseOverlay follows drag
progressiveOverlayMaxOpacitynumber0.35Max overlay opacity
closeThresholdnumber0.25Fraction to trigger close
noBodyStylesbooleanfalseSkip body modifications
containerHTMLElement | nullbodyPortal container
repositionInputsbooleantrueiOS keyboard repositioning
onDrag(e, percent) => voidCalled during drag
onDragStart() => voidDrag started
onDragEnd() => voidDrag ended
onRelease(e, open) => voidPointer released
onAnimationEnd(open) => voidAfter animation completes
onClose() => voidSheet closed

BottomSheet.NestedRoot

Same props as Root. Use for sheets inside other sheets.

BottomSheet.Content

The sheet container. Renders as a <div role="dialog">. Accepts all standard div attributes.

Data attributes

AttributeValues
data-state"open" | "closed"
data-snap-points"true" | "false"
data-floating"true" | "false"
data-animate"true" | "false"

CSS variable

--snap-point-height — the current snap point height in pixels.

BottomSheet.Overlay

Backdrop overlay. Standard div attributes.

BottomSheet.Handle

PropTypeDefaultDescription
preventCyclebooleanfalseDisable tap-to-cycle

BottomSheet.Portal

PropTypeDefaultDescription
containerHTMLElement | nullfrom RootCustom portal target
forceMountbooleanfalseKeep mounted when closed

BottomSheet.Trigger

Button that opens the sheet. Standard button attributes.

BottomSheet.Close

Button that closes the sheet. Standard button attributes.

BottomSheet.Title

Renders <h2>. Linked via aria-labelledby.

BottomSheet.Description

Renders <p>. Linked via aria-describedby.

BottomSheet.FloatingBar

PropTypeDefaultDescription
gapnumber16Space above sheet (px)
hideWhileDraggingbooleanfalseHide during drag
fadeStartPercentnumber50Start fade %
fadeEndPercentnumber65End fade %

useBottomSheet()

Hook to access sheet state and controls from any child component.

const {
  isOpen,              // boolean — sheet is open
  isDragging,          // boolean — user is dragging
  isFullyOpen,         // boolean — at highest snap point
  isMinimized,         // boolean — at lowest snap point
  isClosed,            // boolean — not visible
  activeSnapPoint,     // SnapPoint | null
  activeSnapPointIndex,// number | null
  snapPoints,          // SnapPoint[] | undefined
  modal,               // boolean
  floating,            // boolean
  close,               // () => void
  open,                // () => void
  snapTo,              // (snapPoint: SnapPoint) => void
} = useBottomSheet();

Types

type SnapPoint = number | string;
// number: 0–1 fraction of viewport (0.5 = 50vh)
// string: pixel value ("200px")

CSS Custom Properties

:root {
  --glidesheet-z-index: 50;
  --glidesheet-floating-radius: 1rem;
}