Back to Tooljet

Sheet — Rocket Design Spec

frontend/src/components/ui/Rocket/Sheet/Sheet.spec.md

3.20.154-lts3.4 KB
Original Source

Sheet — Rocket Design Spec

<!-- synced: 2026-04-07 -->

Overview

Sheet is a slide-in panel from the right edge of the viewport. Used for multi-step forms or detail views that need more space than a Dialog can provide (e.g. adding a new datasource through multiple steps).

Wraps Radix Dialog primitives via shadcn (sheet is a Dialog with side animations). Mirrors Dialog's structure (Header / Body / Footer) including the conditional footer overflow border.

Props (SheetContent)

PropTypeValuesDefault
sizestringlarge | default | smalldefault
showCloseButtonbooleantrue
preventClosebooleanfalse

Sizes

ValueWidthTailwind
small400pxtw-w-[400px]
default560pxtw-w-[560px]
large720pxtw-w-[720px]

Sub-components

ComponentWrapsStyling
SheetRadix Dialog.Root (pass-through)none
SheetTriggerRe-export from shadcnnone
SheetCloseRe-export from shadcnnone
SheetPortalRe-export from shadcnnone
SheetOverlayRadix Overlay (direct)tw-bg-black/50, animations
SheetContentRadix Content (direct)size CVA, slide-in from right, tokens
SheetHeaderplain divborder-bottom, fixed 56px height, horizontal padding
SheetBodyplain div (custom)scrollable, ResizeObserver for overflow detection
SheetFooterplain divborder-top (conditional on body overflow), padding
SheetTitleRadix Title (direct)tw-font-title-large + color
SheetDescriptionRadix Description (direct)tw-font-body-small + color

Token Mapping

ElementStateToolJet class
content bgdefaulttw-bg-background-surface-layer-01
content shadowdefaulttw-shadow-elevation-400
content border-leftdefaulttw-border-solid tw-border-l tw-border-border-weak
overlay bgdefaulttw-bg-black/50
header borderdefaulttw-border-solid tw-border-b tw-border-border-weak
header heightdefaulttw-h-14
header paddingdefaulttw-px-6 tw-py-0
title textdefaulttw-font-title-large tw-text-text-default
description textdefaulttw-font-body-small tw-text-text-placeholder
body paddingdefaulttw-p-6
footer border (overflowing)defaulttw-border-solid tw-border-t tw-border-border-weak
footer border (no overflow)defaulttw-border-transparent
footer paddingdefaulttw-px-6 tw-py-4
footer layoutdefaulttw-flex tw-justify-between tw-items-center
close button positiondefaultabsolute top-right of content

CVA Shape

Shape C — sizes only. sheetContentVariants has size CVA for max-width. Rest use static cn().

Notes

  • Right-side only for now (not exposing side prop). Sheet always slides in from the right edge.
  • Slide-in animation via data-[state=open]:tw-slide-in-from-right and data-[state=closed]:tw-slide-out-to-right.
  • Overflow border on footer mirrors Dialog: ResizeObserver on SheetBody detects when content overflows, sets context, footer reads context for border-t color.
  • preventClose blocks overlay click via onInteractOutside + Escape via onEscapeKeyDown (same as Dialog).
  • Close button is positioned absolute top-right of content (same as Dialog).
  • Full viewport height — sheet stretches from top to bottom of the screen.
  • Typography uses tw-font-* plugin utilities.