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:

Terminal
npx nocta-ui add sheet

Then import the component:

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

Basic Usage

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

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

Form Example

Perfect for forms and data entry interfaces.

Great for mobile navigation menus and sidebar navigation.

Controlled State

You can control the Sheet's open state programmatically.

Closed

Customization

You can customize the Sheet's appearance and behavior extensively.

Props

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

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

Accessibility

The Sheet component follows WAI-ARIA guidelines:

  • Uses proper dialog role and aria-modal attributes
  • Implements focus trapping within the sheet
  • Supports keyboard navigation (Tab, Shift+Tab, Escape)
  • Maintains focus management when opening/closing
  • Provides screen reader announcements
  • Supports click-outside-to-close functionality