Skip to content
h v3.13.3
Search the docs
Find a component, section or page.

Sheet

Extends the Dialog component to display content that complements the main content of the screen.

Installation

pnpm add @heyramzi/ui bits-ui

Usage

import * as Sheet from "@heyramzi/ui/shadcn/sheet";
<Sheet.Root>
  <Sheet.Trigger>Edit client</Sheet.Trigger>
  <Sheet.Content side="right">
    <Sheet.Header>
      <Sheet.Title>Edit client</Sheet.Title>
      <Sheet.Description>Shown on invoices and the portal.</Sheet.Description>
    </Sheet.Header>
    <Sheet.Body>
      <input aria-label="Name" value="Acme Corp" />
    </Sheet.Body>
    <Sheet.Footer band>
      <Sheet.Close>Cancel</Sheet.Close>
    </Sheet.Footer>
  </Sheet.Content>
</Sheet.Root>

Keyboard and accessibility

Key Does
Tab Moves focus to the next control inside the sheet.
Shift Tab Moves focus to the previous control inside the sheet.
Esc Closes the sheet and returns focus to the trigger.
  • A sheet is a dialog from the edge, so Tab can't leave it while it's open.
  • The close button is named "Close", or whatever `closeLabel` says.
  • Sheet.Title and Sheet.Description name and describe it for a screen reader.

API reference

Sheet.Root

open bindable boolean
Default false
...rest
Every prop of Dialog.Root from bits-ui
Prop Type Default
open bindable boolean false
...rest Every prop of Dialog.Root from bits-ui

Sheet.Trigger

ref bindable HTMLElement | null
Default null
...rest
Every prop of Dialog.Trigger from bits-ui
Prop Type Default
ref bindable HTMLElement | null null
...rest Every prop of Dialog.Trigger from bits-ui

Sheet.Content

portalProps WithoutChildrenOrChild<ComponentProps<typeof SheetPortal>>
side "left" | "right" | "bottom"
Default "right"
showCloseButton boolean
Default true
closeLabel string
Default "Close"
What a screen reader calls the built-in close button, in the app's language.
floating boolean
From `sm` up a left or right sheet floats 8px off the edge, like SidePanel; `floating={false}` keeps it flush. A phone stays full bleed for the width.
children required Snippet
ref bindable HTMLElement | null
Default null
class string
...rest
Every prop of Dialog.Content from bits-ui except child, children
Prop Type Default
portalProps WithoutChildrenOrChild<ComponentProps<typeof SheetPortal>>
side "left" | "right" | "bottom" "right"
showCloseButton boolean true
closeLabel

What a screen reader calls the built-in close button, in the app's language.

string "Close"
floating

From `sm` up a left or right sheet floats 8px off the edge, like SidePanel; `floating={false}` keeps it flush. A phone stays full bleed for the width.

boolean
children required Snippet
ref bindable HTMLElement | null null
class string
...rest Every prop of Dialog.Content from bits-ui except child, children

Sheet.Header

ref bindable HTMLDivElement | null
Default null
class string
children Snippet
...rest
Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements
Prop Type Default
ref bindable HTMLDivElement | null null
class string
children Snippet
...rest Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements

Sheet.Title

ref bindable HTMLElement | null
Default null
class string
...rest
Every prop of Dialog.Title from bits-ui
Prop Type Default
ref bindable HTMLElement | null null
class string
...rest Every prop of Dialog.Title from bits-ui

Sheet.Description

ref bindable HTMLElement | null
Default null
class string
...rest
Every prop of Dialog.Description from bits-ui
Prop Type Default
ref bindable HTMLElement | null null
class string
...rest Every prop of Dialog.Description from bits-ui
band boolean
Default false
A hairline on top and a quiet surface edge to edge, following the sheet's bottom corners when it floats. A bare `data-band` attribute does the same.
ref bindable HTMLDivElement | null
Default null
class string
children Snippet
...rest
Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements
Prop Type Default
band

A hairline on top and a quiet surface edge to edge, following the sheet's bottom corners when it floats. A bare `data-band` attribute does the same.

boolean false
ref bindable HTMLDivElement | null null
class string
children Snippet
...rest Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements

Sheet.Close

ref bindable HTMLElement | null
Default null
...rest
Every prop of Dialog.Close from bits-ui
Prop Type Default
ref bindable HTMLElement | null null
...rest Every prop of Dialog.Close from bits-ui

Sheet.Portal

...rest
Every prop of Dialog.Portal from bits-ui
Prop Type Default
...rest Every prop of Dialog.Portal from bits-ui

Sheet.Overlay

ref bindable HTMLElement | null
Default null
class string
...rest
Every prop of Dialog.Overlay from bits-ui
Prop Type Default
ref bindable HTMLElement | null null
class string
...rest Every prop of Dialog.Overlay from bits-ui

Sheet.Body

ref bindable HTMLDivElement | null
Default null
class string
children Snippet
...rest
Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements
Prop Type Default
ref bindable HTMLDivElement | null null
class string
children Snippet
...rest Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements