NOCTA UI

Sheet

A slide-out panel component that can be triggered from any side of the screen

Installation

Install the Sheet component using the nocta-ui CLI:

npx nocta-ui add sheet

Import the component:

import {
  Sheet,
  SheetTrigger,
  SheetContent,
  SheetHeader,
  SheetTitle,
  SheetDescription,
  SheetFooter,
  SheetClose
} from '@/components/ui/sheet';

Example

The Sheet component provides a slide-out panel that can appear from any side of the screen.

Sides

The Sheet can slide in from any side of the screen: left, right, top, or bottom.

Sizes

Six size options are available: sm, md, lg, xl, and full. The default size is md.

Resizable

Enable the resizable prop to let users drag the sheet edge. Combine it with allowShrink if the sheet should shrink below its initial size.

Api Reference

Sheet

PropTypeDefaultDescription
childrenReact.ReactNodeSheet content including trigger and content components
openbooleanControlled open state
onOpenChange(open: boolean) => voidCallback when open state changes

SheetTrigger

PropTypeDefaultDescription
childrenReact.ReactNodeTrigger content
asChildbooleanfalseRender as child element
classNamestring''Additional CSS classes

SheetContent

PropTypeDefaultDescription
childrenReact.ReactNodeSheet content
classNamestring''Additional CSS classes
side'left' | 'right' | 'top' | 'bottom''right'Side from which sheet slides in
size'sm' | 'md' | 'lg' | 'xl' | 'full''md'Sheet size
showClosebooleantrueShow default close button
resizablebooleanfalseDisplay resize handles on the sheet edge
allowShrinkbooleanfalsePermit resizing below the initial layout size

SheetHeader, SheetTitle, SheetDescription, SheetFooter

PropTypeDefaultDescription
childrenReact.ReactNodeContent
classNamestring''Additional CSS classes

SheetClose

PropTypeDefaultDescription
childrenReact.ReactNode'Close'Button content
classNamestring''Additional CSS classes
asChildbooleanfalseRender as child element