sigilUI

Drawer

Reveal supporting content in a dismissible edge panel.

@sigil-ui/componentsReact

Preview

Live preview Interactive

Import

import { Drawer, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription } from "@sigil-ui/components";

Usage

<Drawer>
  <DrawerTrigger asChild><Button variant="outline">Open drawer</Button></DrawerTrigger>
  <DrawerContent>
    <DrawerHeader>
      <DrawerTitle>Settings</DrawerTitle>
      <DrawerDescription>Adjust your preferences.</DrawerDescription>
    </DrawerHeader>
    <DrawerFooter>
      <DrawerClose asChild><Button variant="ghost">Close</Button></DrawerClose>
    </DrawerFooter>
  </DrawerContent>
</Drawer>

Sub-components

This component includes the following parts:

  • <DrawerTrigger>
  • <DrawerClose>
  • <DrawerContent>
  • <DrawerHeader>
  • <DrawerFooter>
  • <DrawerTitle>
  • <DrawerDescription>

Props

PropTypeDefaultDescription
shouldScaleBackgroundboolean——
openboolean——
onOpenChange(open: boolean) => void——

Token integration

CSS VariablePurpose
--s-overlay-bgOverlay bg
--s-overlay-blurOverlay blur
--s-overlay-radiusOverlay radius
--s-radius-lgRadius lg
--s-overlay-borderOverlay border
--s-borderBorder
--s-border-styleBorder style
--s-overlay-surfaceOverlay surface
--s-surfaceSurface
--s-overlay-shadowOverlay shadow
--s-shadow-xlShadow xl
--s-radius-fullRadius full