Overlays

Sheet

A slide-in panel for presenting additional content without disrupting the main screen. It slides in from the side to show related information or options.

Loading...

Installation

Install the component via the CLI in one command.

npx shadcn@latest add @intentui/sheet

Composed components

When you install this component via the CLI, it automatically loads all composed components, so you don’t need to add them individually.

Manual installation

Use this approach if you prefer to install and wire up the component yourself instead of using the CLI.

npm install react-aria-components tailwind-merge tailwind-variants

Anatomy

import { Button } from "@/components/ui/button"
import {
  Sheet,
  SheetBody,
  SheetClose,
  SheetContent,
  SheetDescription,
  SheetFooter,
  SheetHeader,
  SheetTitle,
  SheetTrigger,
} from "@/components/ui/sheet"
<Sheet>
  <SheetTrigger>Open</SheetTrigger>
  <SheetContent>
    <SheetHeader>
      <SheetTitle>Sheet Title</SheetTitle>
      <SheetDescription>Sheet Description</SheetDescription>
    </SheetHeader>
    <SheetBody>Sheet Body</SheetBody>
    <SheetFooter>
      <SheetClose>Cancel</SheetClose>
      <Button>Save</Button>
    </SheetFooter>
  </SheetContent>
</Sheet>

Examples

Like github

This example is like Github's profile page. You can see the sheet component is used to display the profile information.

Loading...

Controlled

You can control the open state of the sheet by using the isOpen prop. You can also use the onOpenChange prop to listen to the open state change.

Loading...

Positioning

You can position the modal component in different ways. You can use the side prop to position the modal component in the different directions.

Loading...

Custom close

You can customize the close button by using the SheetClose component. This example demonstrates how to use the SheetClose component to create a custom close button.

Loading...

Float

By default, the sheet will stack, but you can change this behavior by using the isFloat prop. This example demonstrates how to use the isFloat prop to create a sheet that does not stack.

Loading...

Sticky

You can use the SheetBody component to make the sheet sticky.

Loading...

Component API

Sheet

The Sheet component controls the sheet trigger and content.

SheetTrigger

The SheetTrigger component defines the element that opens a sheet.

PropTypeDefault
classNamestring-

SheetContent

The SheetContent component renders the slide-in sheet panel.

PropTypeDefault
classNamestring-
closeButtonbooleantrue
isFloatbooleantrue
overlayOmit<ModalOverlayProps, "children">-
side"top" | "bottom" | "left" | "right"right

SheetHeader

The SheetHeader component groups the sheet title and description.

PropTypeDefault
classNamestring-
descriptionstring-
titlestring-

SheetTitle

The SheetTitle component renders the sheet heading.

PropTypeDefault
classNamestring-

SheetDescription

The SheetDescription component renders supporting text inside a sheet.

PropTypeDefault
classNamestring-

SheetBody

The SheetBody component wraps the main sheet content.

PropTypeDefault
classNamestring-

SheetFooter

The SheetFooter component groups sheet actions.

PropTypeDefault
classNamestring-

SheetClose

The SheetClose component renders a button that closes the sheet.

PropTypeDefault
classNamestring-
intent"primary" | "secondary" | "warning" | "danger" | "success" | "outline" | "plain"plain

See the React Aria for the full API reference.

Unlock the full power of
Intent UI Design

Build modern web apps faster with 1000+ resources across components, blocks, patterns, templates, and starter kits.

Learn more