Sheet

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

Sheet extends the React Aria Components <DialogTrigger> component.

SheetTrigger

SheetTrigger extends the Intent UI <DialogTrigger> component.

classNamestring

SheetContent

SheetContent extends the React Aria Components <ModalOverlay> component.

classNamestring
closeButtonboolean
Default: true
isFloatboolean
Default: true
overlayOmit<ModalOverlayProps, "children">
side"top" | "bottom" | "left" | "right"
Default: right

SheetHeader

SheetHeader extends the Intent UI <DialogHeader> component.

classNamestring
descriptionstring
titlestring

SheetTitle

SheetTitle extends the Intent UI <DialogTitle> component.

classNamestring

SheetDescription

SheetDescription extends the Intent UI <DialogDescription> component.

classNamestring

SheetBody

SheetBody extends the Intent UI <DialogBody> component.

classNamestring

SheetFooter

SheetFooter extends the Intent UI <DialogFooter> component.

classNamestring

SheetClose

SheetClose extends the Intent UI <DialogClose> component.

classNamestring
intent"primary" | "secondary" | "warning" | "danger" | "success" | "outline" | "plain"
Default: plain

See the React Aria for the full API reference.