Menu

Bottom sheet

Mobile sheet. 2 types.

Order #1042

Installation

$ npx uix-ui@latest add sheet

This copies the file into components/ui/sheet.tsx in your project. npx shadcn@latest add @uix/sheet works too.

Usage

sheet.tsx
import { Sheet } from "@/components/ui/sheet";

<>
  <Button variant="outline" onClick={() => setOpen(true)}>More actions</Button>
  <Sheet
    open={open}
    onClose={() => setOpen(false)}
    title="Order #1042"
    actions={[
      { label: "Copy order number", icon: <Copy /> },
      { label: "Save for later", icon: <Star /> },
      { label: "Cancel order", icon: <Zap />, destructive: true },
    ]}
  />
</>

Props

PropTypeDefaultDescription
openboolean–
onClose() => void–
titleReact.ReactNode–
actionsSheetAction[]–Rows of icon + label; pressing one calls its onSelect and closes the sheet.
footerReact.ReactNode–Buttons under the content (a full-width Button works well).

Everything else is passed to the root element, so className, aria-* and event handlers work as usual.

Dependencies

Installed for you by the CLI.

  • class-variance-authority
  • clsx
  • tailwind-merge
  • lib/utils.ts
esc

↑↓ to navigate · ↵ to select · esc to close