Back to Tooljet

Dialog — Rocket Design Spec

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

3.20.154-lts3.8 KB
Original Source

Dialog — Rocket Design Spec

<!-- figma: https://www.figma.com/design/XQdM9x8x9YHcj1lUK8abUG/Rocket-components?node-id=8996-1514 --> <!-- synced: 2026-03-25 -->

Props (DialogContent)

PropTypeValuesDefault
sizestringsmall | default | large | extraLarge | fullscreendefault
showCloseButtonbooleantrue
preventClosebooleanfalse

Props (DialogBody)

PropTypeValuesDefault
noPaddingbooleanfalse
scrollablebooleanfalse

Sizes

ValueMax-widthTailwind
small400pxtw-max-w-[400px]
default480pxtw-max-w-[480px]
large640pxtw-max-w-[640px]
extraLarge768pxtw-max-w-[768px]
fullscreen100vw/100vhtw-max-w-none tw-w-screen tw-h-screen tw-rounded-none

Token Mapping

ElementStateFigma tokenToolJet class
content bgdefaultbg-surface-layer-01tw-bg-background-surface-layer-01
content shadowdefaultElevations/400tw-shadow-elevation-400
content radiusdefault8pxtw-rounded-lg
header borderdefaultborder/weaktw-border-solid tw-border-b tw-border-border-weak
header heightdefault56pxtw-h-14
header paddingdefault24px horizontaltw-px-6 tw-py-0
title textdefaulttext/default 14px Mediumtw-font-title-large tw-text-text-default
description textdefaulttext/placeholder 11px Regulartw-font-body-small tw-text-text-placeholder
body paddingdefault24pxtw-p-6
footer borderdefaultborder/weaktw-border-solid tw-border-t tw-border-border-weak
footer paddingdefault24px h / 16px vtw-px-6 tw-py-4
footer layoutdefaulttw-justify-between (outline left, primary right)
overlay bgdefaultblack/50tw-bg-black/50
close buttondefaulticon/defaulttw-text-icon-default
close buttonhoverhover:tw-text-icon-strong

Sub-components

ComponentWrapsStyling
DialogRadix Root (pass-through)none
DialogTriggerRe-export from shadcnnone
DialogCloseRe-export from shadcnnone
DialogPortalRe-export from shadcnnone
DialogContentRadix Content (direct)size CVA, tokens, preventClose, close button
DialogOverlayRadix Overlay (direct)tw-bg-black/50, animations
DialogHeaderplain divborder-bottom, fixed 56px height, horizontal padding
DialogBodyplain div (custom)noPadding, scrollable
DialogFooterplain divborder-top, justify-between layout
DialogTitleRadix Title (direct)tw-font-title-large + color
DialogDescriptionRadix Description (direct)tw-font-body-small + color

CVA Shape

Shape E — compound/multi-part. Only DialogContent gets CVA (for size). Rest use static cn().

Notes

  • Uses Radix primitives directly (not shadcn wrappers) for Overlay, Content, Title, Description — ensures Rocket controls the overlay bg
  • No anchor context needed — Dialog is centered, not positioned relative to trigger
  • preventClose blocks overlay click via onInteractOutside + Escape via onEscapeKeyDown
  • scrollable adds tw-overflow-y-auto tw-max-h-[85vh] to the body area (on DialogBody, not DialogContent)
  • noPadding removes default body padding (header/footer keep theirs) — on DialogBody
  • fullscreen size removes border-radius and uses full viewport
  • Header/footer borders appear on ALL sizes (no conditional)
  • Footer uses justify-between — outline/cancel button on left, primary on right
  • Close button positioned absolute top-right of content
  • Typography uses plugin token utilities (tw-font-title-large, tw-font-body-small) — not manual font combos