Sheet

A floating 480 side panel for forms and records.

$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/sheet.json

Form sheet

480 wide, 12 inset, radius 16, shadow-modal, backdrop with 2 px blur. Motion: transitions.dev panel reveal: slides in from the right + fade + 2 px cross-blur, open 400 / close 350, ease-smooth-out. Type in a field, then close: "Buang perubahan?" asks first.

Open state (inline)

Header: title 18/24 + description + round close ("Tutup"). Body scrolls, fields 20 apart; the round arrow shows while more is below. Footer: two buttons that hug their labels, aligned right. Right: footer "detail" (Tutup + one secondary action).

Ajukan cuti

Permintaan dikirim ke HR untuk disetujui.

Slip November · Dimas

Dibayar Rabu, 25 Nov 2026

Gaji bersih diterimaRp 12.509.137

When to use

  • A form with 2 or more fields: Ajukan cuti, Tambah karyawan, Minta perubahan ke HR.
  • "Ubah" on a DetailCard: the sheet shows only that card's fields (Ubah kontak darurat).
  • Reading one record without leaving the list: Slip November, Perbaiki baris.

When not to use

  • One confirmation or one field → Dialog.
  • A flow with steps or a full table (Impor dari Excel) → its own page with a stepper.
  • A short list of actions → DropdownMenu.
  • Never open a sheet on top of a sheet. The only Dialog over a sheet is its own discard question.

Do and don't

DoOnly the card's own fields"Ubah" on Kontak darurat opens Nama, Hubungan, Telepon: nothing else. The title is verb + the card name.
Don'tEdge-to-edge drawer or a third footer buttonAlways the 12 inset and radius 16. No primary on the left, no third button, no width other than 480.

Installation

Add Sheet with the shadcn CLI (your project needs a components.json and the MaHR theme: https://mahrdesign.faizintifada.com/r/theme.json), or copy the files by hand.

terminal
bunx --bun shadcn@latest add https://mahrdesign.faizintifada.com/r/sheet.json

API

import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetBody, SheetFooter, SheetClose } from "@/components/ui/sheet"
PropTypeDefaultDescription
open · onOpenChange · defaultOpenboolean · (open, details) => void · boolean–Base UI Root props.
dirtybooleanfalsetrue → closing (×, Esc, backdrop, Batal) asks "Buang perubahan?" first, in a centred destructive Dialog over the sheet (Kembali / Buang). Esc or Kembali closes only the question. On open, focus goes to the first field in SheetBody.
discard{ title?, description?, keep?, discard? }Buang perubahan? · Kembali · BuangOther words for the discard Dialog of one form, e.g. Tambah karyawan: "Buang data yang sudah diisi?" · "Data Putri Ramadhani belum disimpan. Jika ditutup sekarang, semua isian hilang." · "Lanjut isi" · "Ya, buang data". The safe button keeps focus.
defaultAskingbooleanfalsePreview and tests only: start with the discard question shown.
SheetHeader title · descriptionReactNode–Title = verb + object. Description one line.
SheetBodydiv–Scrolls; fields gap 20; the scroll hint appears by itself.
SheetFooterdiv–Two buttons that hug their labels, aligned right. form: Batal + primary. detail: Tutup + one secondary.