Equality
Equality

Sheet

A slide-out panel that overlays content from the edge of the screen

Overview

The Sheet component is a modal dialog that slides in from the edge of the screen. It’s useful for displaying supplementary content, without navigating away from the current page.

Usage

Import the component:

import {
  Sheet,
  SheetContainer,
  SheetContent,
  SheetDescription,
  SheetFooter,
  SheetHeader,
  SheetHeaderIcon,
  SheetTitle,
  SheetTrigger,
} from "@eqtylab/equality";

Basic usage with required properties:

<Sheet>
  <SheetTrigger asChild>
    <Button>Open Sheet</Button>
  </SheetTrigger>
  <SheetContainer>
    <SheetHeader>
      <SheetTitle>Sheet Title</SheetTitle>
      <SheetDescription>Sheet description goes here</SheetDescription>
    </SheetHeader>
    <SheetContent>Your content goes here</SheetContent>
    <SheetFooter>
      <Button>Action</Button>
    </SheetFooter>
  </SheetContainer>
</Sheet>

With an optional header icon:

<SheetHeader>
  <SheetHeaderIcon>
    <Avatar>
      <AvatarFallback>JD</AvatarFallback>
    </Avatar>
  </SheetHeaderIcon>
  <SheetTitle>Sheet Title</SheetTitle>
  <SheetDescription>Sheet description goes here</SheetDescription>
</SheetHeader>

Variants

Side Position

The Sheet can slide in from any side of the screen using the side prop on SheetContainer. Available values: "top", "bottom", "left", "right" (default).

<SheetContainer side="right">
  <SheetHeader>
    <SheetTitle>Sheet Title</SheetTitle>
    <SheetDescription>Sheet description</SheetDescription>
  </SheetHeader>
  <SheetContent>Content goes here</SheetContent>
</SheetContainer>

Slots

NameDescription
SheetTriggerThe button or element that triggers the sheet to open
SheetContainerThe main container that wraps all sheet content and controls the slide position
SheetHeaderA container for the title and description, positioned at the top of the sheet
SheetHeaderIconOptional icon container positioned to the left of the title and description
SheetTitleThe accessible title for the sheet (required for accessibility)
SheetDescriptionOptional description that provides additional context about the sheet’s purpose
SheetContentThe scrollable body area for the main content of the sheet
SheetFooterA container for actions or buttons, positioned at the bottom of the sheet
SheetCloseA component that closes the sheet when clicked (automatically included)

Props

Sheet

NameDescriptionTypeDefaultRequired
openControlled open state of the sheetboolean-
onOpenChangeCallback when the open state changesfunction-
defaultOpenDefault open state for uncontrolled usagebooleanfalse
modalWhether the sheet should trap focusbooleantrue

SheetContainer

NameDescriptionTypeDefaultRequired
sideThe side of the screen to slide fromtop, bottom, left, rightright