Back to Tooljet

Empty — Rocket Design Spec

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

3.20.154-lts1.7 KB
Original Source

Empty — Rocket Design Spec

<!-- synced: 2026-03-23 -->

Props

PropTypeValuesDefault
sizestringlarge | default | smalldefault

Sub-components

Sub-componentRoleNotes
EmptyRoot containerFlex column, centered, dashed border
EmptyMediaIllustration / icon slotAccepts variant: default (freeform) or icon (contained box)
EmptyHeaderGroups title + descriptionMax-width constrained
EmptyTitleHeading text
EmptyDescriptionSupporting textMuted color
EmptyContentAction area (footer)Slot for buttons / links

Sizes

ValuePaddingIcon size (variant=icon)Title textDescription text
smalltw-p-4tw-size-8tw-font-title-defaulttw-text-xs
defaulttw-p-6tw-size-10tw-font-title-largetw-text-sm
largetw-p-8tw-size-12tw-font-title-x-largetw-text-sm

Slots

  • media (optional, ReactNode) — illustration, image, or icon
  • title (required, string)
  • description (optional, string)
  • content/actions (optional, ReactNode) — buttons, links

CVA Shape

Shape E — compound/multi-part

  • Empty (root): size CVA (padding, gap, rounded)
  • EmptyMedia: media variant CVA (default | icon) + size context for icon dimensions
  • EmptyTitle: size context for text size
  • EmptyDescription: size context for text size
  • EmptyHeader: static cn()
  • EmptyContent: static cn()

Notes

  • Size is set on root <Empty size="..."> and propagated to children via React context
  • Only one visual variant ("default") so no variant CVA on root — size is the only axis
  • EmptyMedia keeps its own variant prop (default vs icon) from shadcn