Primitives

Slot

An invisible wrapper container. Controls the size and alignment of any nested component — no background, borders, or shadows of its own.

v3.1.0 Status: Draft Primitive Updated 2026-05-19
States
Slot has no visual states — it is transparent. The four layout modes (width × height) are its functional configurations. All demos show Slot with a dashed border to make the invisible boundary visible.
width: hug · height: hug (default)
slot
Component
width: fill · height: hug
slot
Component
width: hug · height: fill
slot
Component
width: fill · height: fill
slot
Component
DimensionModeCSSDefault
Widthhugwidth: fit-contentYes
Widthfillflex: 1 1 0; min-width: 0—
Heighthugheight: fit-contentYes
Heightfillalign-self: stretch—
Slot has no background, border, or shadow tokens — it is visually transparent in all modes.
Anatomy
Slot contains exactly one child. Only vertical padding is allowed — no horizontal padding, no visual decoration.
┌─ Slot ──────────────────────────────────┐ │ ▲ padding-top (SP token, default s0) │ │ │ │ ┌─ content ──────────────────────┐ │ │ │ [any DS component] │ │ │ └────────────────────────────────┘ │ │ │ │ ▼ padding-bottom (SP token, default s0)│ └─────────────────────────────────────────┘
ElementRequiredDescription
contentRequiredThe single child. Any DS component. Slot is not a Row or Column — it holds exactly one child.
padding-topOptionalInner top padding. SP token only, default --sp-s0.
padding-bottomOptionalInner bottom padding. SP token only, default --sp-s0.
Hard constraints: No horizontal padding · No background · No border · No shadow · No role · No aria · Exactly one child
Layout
Four properties control Slot's layout behavior. Width and height each have two binary modes. Alignment only has effect when the respective dimension is fill.
ValueBehaviorCSSFigma
hug · defaultWidth shrinks to contentwidth: fit-contentWidth: Hug
fillWidth expands to fill the parentflex: 1 1 0Width: Fill
ValueBehaviorCSSFigma
hug · defaultHeight shrinks to content + paddingheight: fit-contentHeight: Hug
fillHeight expands to fill the parentalign-self: stretchHeight: Fill
ValueBehaviorCSS justify-content
start · defaultContent aligned to the left edgeflex-start
centerContent centered horizontallycenter
endContent aligned to the right edgeflex-end
stretchContent stretched to full widthstretch
ValueBehaviorCSS align-items
top · defaultContent aligned to the top edgeflex-start
centerContent centered verticallycenter
bottomContent aligned to the bottom edgeflex-end
stretchContent stretched to full heightstretch
PropertyAllowed valuesDefault
padding-topSP tokens: s0 s2 s4 s6 s8 s12 s16 s20 s24 s32 s40 s48 s56 s64 s80 s96--sp-s0
padding-bottomsame SP tokens--sp-s0
fill × hug · align-h: center
slot
Component
Centered block at full column width
fill × hug · align-h: stretch
slot
Component
Full-width button or row
fill × fill · align: center / center
slot
Component
Full-screen centered overlay
hug × hug · padding-top: s16
slot
Component
Top spacing via padding instead of outer gap
Animation
Slot has no animations or transitions of its own. If Slot wraps an animated component, the animation belongs to the nested component — not to Slot.
ElementPropertyAnimation
SlotallNone — Slot does not animate
Nested componentanyGoverned by the nested component's own motion tokens
@media (prefers-reduced-motion: reduce) { /* Slot has no animation — intentionally empty */ }
Slot does not respond to press, hover, or focus — no state transitions exist. For entrance or exit animations on a Slot-wrapped component, apply the DS motion tokens to the nested element, not to .slot.
Usage
Use Slot when you need to change the layout behavior of a component without modifying the component itself.
When to use
  • Wrap a component to change its width or height behavior (hug ↔ fill)
  • Add vertical spacing between components via padding-top or padding-bottom
  • Center or align a component inside a parent container
  • Inside Cell, Card, Bottom Sheet — to position nested elements within a slot zone
When not to use
  • When horizontal padding is needed — use the component's own padding or the parent layout instead
  • When placing multiple components side by side — Slot is single-child only; use a Row/Stack layout
  • When a visible container is needed (background, border, shadow) — use Card or Surface
  • As a substitute for component-level padding — prefer padding inside the component itself when possible
ComponentRelationship
CellSlot is used for the leading and trailing slots of the cell to control their size behavior
CardSlot wraps the card content, controlling vertical padding
Bottom Sheetheight: fill via Slot stretches the content zone to fill the sheet
Buttonwidth: fill via Slot makes the button full-width without modifying the button itself
Accessibility
Slot is semantically transparent. It renders as a plain <div> with no role, no ARIA attributes, and no focus behavior. All accessibility responsibility belongs to the nested component.
ElementRoleARIANotes
Slot (.slot)nonenonePlain <div>. Never add role, aria-label, or any aria-*
Nested componentown roleown ariaFully responsible for its own semantics and focus
BehaviorNotes
Slot is not in the tab orderNo tabindex. Focus skips directly to the nested component if it is focusable
No focus indicatorSlot never receives focus — no outline needed
No contrast requirementSlot is invisible — no background or border to measure
Full accessibility spec: specs/primitives/slot-a11y.md