Xzero UI
Pro library

Bottom sheet

A sheet that rests at a peek or full height and follows your finger.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/bottom-sheet
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/bottom-sheet

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { BottomSheet, BottomSheetClose } from "@/components/xzero/bottom-sheet/bottom-sheet";
import { Button } from "@/components/xzero/button/button";

export function TripSheet() {
  return (
    <BottomSheet
      trigger={<Button>Trip details</Button>}
      title="Lisbon, 3 nights"
      description="Oct 12 to Oct 15"
      detents={[0.4, 0.9]}
    >
      <p>Flights, hotel, and bookings.</p>
      <BottomSheetClose asChild><Button variant="secondary">Done</Button></BottomSheetClose>
    </BottomSheet>
  );
}

Examples

Controlled sheet with detent tracking

<BottomSheet
  open={open}
  onOpenChange={setOpen}
  title="Filters"
  detents={[0.5]}
  onDetentChange={index => track("detent", index)}
>
  <FilterList />
</BottomSheet>

API reference

BottomSheet

A modal sheet that rises from the bottom edge and rests at one or more detents, with drag, flick, and keyboard control.

PropTypeDefaultDescription
title (required)string–Sheet title, rendered as Dialog.Title.
children (required)ReactNode–Scrollable sheet content.
triggerReactNode–Control that opens the sheet. Rendered with asChild; focus returns to it on close.
openboolean–Controlled open state.
defaultOpenbooleanfalseInitial open state when uncontrolled.
onOpenChange(open: boolean) => void–Called when the sheet opens or closes.
descriptionstring–Supporting line, rendered as Dialog.Description.
detentsnumber[][0.45, 0.92]Resting heights as fractions of the viewport height.
initialDetentnumber0Index into the sorted detents the sheet opens at.
onDetentChange(index: number) => void–Called when the sheet settles on a different detent.
closeLabelstring"Close"aria-label of the close button.
classNamestring–Class on the sheet surface.

BottomSheetClose

Radix Dialog.Close for buttons inside the sheet.

PropTypeDefaultDescription
...propsComponentPropsWithoutRef<typeof DialogPrimitive.Close>–Radix close props, including asChild.

Keyboard interactions

KeysAction
ArrowUp / ArrowDownOn the grabber, moves one detent up or down.
Home / EndOn the grabber, jumps to the tallest or smallest detent.
Enter / SpaceOn the grabber, toggles between smallest and tallest detent.
ArrowDown / PageDown / SpaceOn the sheet, expands to full height first, then scrolls the content.
EscapeCloses the sheet.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in overlays

Guidance for AI tools

Bottom sheet: A sheet that rests at a peek or full height and follows your finger. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components