Zephora UI

Overlay

Sheet

Modal slide-in panel anchored to a screen edge. Same semantics as Dialog (backdrop, focus trap, Escape, scroll lock) with a slide animation and four sides. Composes with SheetHeader/Body/Footer, SheetTitle/Description and SheetClose.

Import

import { Sheet, SheetHeader, SheetBody, SheetFooter, SheetTitle, SheetDescription, SheetClose } from "@zephora/react";

Examples

Basic sheet

Slides in from the end (right in LTR) by default.

Sides

`side` picks the edge the panel slides in from.

API

Sheet props

PropTypeDefaultDescription
openbooleanControlled open state.
defaultOpenbooleanfalseInitial open state (uncontrolled).
onOpenChange(open: boolean) => voidCalled whenever the sheet requests an open state change.
side"start" | "end" | "top" | "bottom""end"Edge the panel slides in from.
size"sm" | "md" | "lg" | "full""md"Panel size along its sliding axis.
closeOnOverlayClickbooleantrueClicking the backdrop closes the sheet.
closeOnEscapebooleantruePressing Escape closes the sheet.
showClosebooleantrueRenders a SheetClose "X" button in the header area. Set to false when you place your own <SheetClose />.
initialFocusRefRefObject<HTMLElement | null>Element focused when the sheet opens (defaults to the first focusable).
classNamesPartial<Record<SheetSlot, string>>Per-slot class overrides set once on the root: "root" / "panel" (both target the panel, which is the root element — className still lands there last) | "backdrop" | "header" | "body" | "footer" | "title" | "description" | "close". Appended after the module classes and also applied in unstyled mode.
unstyledbooleanfalseHeadless mode — skips Zephora styling.

SheetHeader / SheetBody / SheetFooter / SheetTitle / SheetDescription props

PropTypeDefaultDescription
unstyledbooleanfalseHeadless mode. SheetTitle and SheetDescription also auto-wire themselves to the panel via aria-labelledby / aria-describedby.
…restHTMLAttributesNative element props are forwarded.

SheetClose props

PropTypeDefaultDescription
childrenReactNodeCustom close glyph; defaults to an X icon.
aria-labelstring"Close"Accessible name of the close button.
unstyledbooleanfalseHeadless mode.

Keyboard

KeyAction
EscapeCloses the sheet (unless closeOnEscape is false).
Tab / Shift+TabCycles focus inside the panel — focus is trapped while open.