Skip to content
coatx
Esc
↑↓navigate↵open⌘Jpreview
On this page

Sheet

Edge-anchored modal sheet panel supporting top, right, bottom, and left sides.

Usage

import {
  Drawer,
  DrawerBackdrop,
  DrawerClose,
  DrawerContent,
  DrawerDescription,
  DrawerTitle,
  DrawerTrigger,
} from "@ilha/ui-sdk/drawer";
import { button } from "coatx/button";
import {
  sheetBackdrop,
  sheetClose,
  sheetContent,
  sheetDescription,
  sheetHeader,
  sheetTitle,
} from "coatx/sheet";

export const SideSheet = () => (
  <Drawer side="right">
    <DrawerTrigger {...button({ variant: "outline" })}>
      Open sheet
    </DrawerTrigger>
    <DrawerBackdrop {...sheetBackdrop()} />
    <DrawerContent {...sheetContent({ side: "right" })}>
      <div {...sheetHeader()}>
        <DrawerTitle {...sheetTitle()}>Inspector</DrawerTitle>
        <DrawerDescription {...sheetDescription()}>
          Press Escape or click outside to close.
        </DrawerDescription>
      </div>
      <DrawerClose aria-label="Close" {...sheetClose()}>
        ×
      </DrawerClose>
    </DrawerContent>
  </Drawer>
);

Exports (coatx/sheet)

Export Description
sheetBackdrop(options?) Dimmed backdrop
sheetContent(options?) Edge-anchored drawer panel
sheetHeader(options?) Header stack
sheetFooter(options?) Bottom-pinned footer
sheetTitle(options?) Heading slot
sheetDescription(options?) Description copy slot
sheetClose(options?) Dismiss button
sheetStyles Compiled StyleX style map

Options

Option Type Default
side "top", "right", "bottom", "left" (content) "right"

Was this page helpful?