"use client";
import { BottomSheet } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
defaultSnapPoint | number | — | Initial snap point index (uncontrolled; default: the largest). |
snapPoints | readonly number[] | — | Heights the sheet rests at, as fractions of the viewport height, e.g. [0.4, 0.9]; the content scrolls inside. Without them the sheet fits its content. With two or more, the handle is a "Resize sheet" button: Enter/Space cycles, ArrowUp/ArrowDown step, Home/End jump. |
title | ReactNode | — | Title (any content). |
trigger | ReactElement | — | Element that toggles it (gets aria-expanded/aria-controls). |
backdropProps | HTMLAttributes<HTMLDivElement> | — | Props for the backdrop behind the panel (className, style, …). |
closeLabel | string | from the message catalog | Accessible name of the close button (default from the message catalog). |
container | Element | DocumentFragment | null | document.body | Portal container (default document.body). |
defaultOpen | boolean | — | Initial open state when uncontrolled. |
description | ReactNode | — | Supporting text. |
draggable | boolean | true | Drag the handle/header down to dismiss (default true). |
defaultSnapPointnumber
Initial snap point index (uncontrolled; default: the largest).
snapPointsreadonly number[]
Heights the sheet rests at, as fractions of the viewport height, e.g. [0.4, 0.9]; the content scrolls inside. Without them the sheet fits its content. With two or more, the handle is a "Resize sheet" button: Enter/Space cycles, ArrowUp/ArrowDown step, Home/End jump.
titleReactNode
Title (any content).
triggerReactElement
Element that toggles it (gets aria-expanded/aria-controls).
backdropPropsHTMLAttributes<HTMLDivElement>
Props for the backdrop behind the panel (className, style, …).
closeLabeldefault from the message catalogstring
Accessible name of the close button (default from the message catalog).
containerdefault document.bodyElement | DocumentFragment | null
Portal container (default document.body).
defaultOpenboolean
Initial open state when uncontrolled.
descriptionReactNode
Supporting text.
draggabledefault trueboolean
Drag the handle/header down to dismiss (default true).
Other props are passed to the root element (HTMLAttributes<HTMLElement>), including className, style, id and aria-* attributes.
<BottomSheet snapPoints={[0.5, 0.9]} defaultSnapPoint={0} title="Actions" trigger={<Button>Open sheet</Button>}>…</BottomSheet>