Getting StartedInstall and bootstrap headless foundations 4
FormHeadless input and selection contracts 19
LayoutHeadless structural primitives for expandable and container patterns 6
NavigationHeadless trails, trees, menus, and command surfaces 7
OverlayHeadless modal and floating layer behavior 3
FeedbackHeadless notification and status communication patterns 5
UtilityReusable action, identity, and clipboard behavior 6

Styling contract

Headless dialog publishes slot and state hooks for the modal root, backdrop, panel, and action controls. Style those hooks directly instead of depending on descendant selectors or wrapper classes.

Slot and state hooks

  • [data-slot="dialog"] mirrors data-open, data-state, and data-disabled.
  • [data-slot="dialog-backdrop"] is the fixed overlay layer that owns spacing and backdrop visuals.
  • [data-slot="dialog-panel"] is the focus target with open-state attributes.
  • [data-slot="dialog-content"] wraps the body region when you use tngDialogContent.
  • [data-slot="dialog-trigger"], [data-slot="dialog-close"], [data-slot="dialog-title"], [data-slot="dialog-description"], and [data-slot="dialog-actions"] provide stable hooks for shell polish.

CSS starter

headless-dialog.css

css
[data-slot="dialog-backdrop"] {
  --tng-dialog-width: 64rem;
  align-items: center;
  background: rgb(2 6 23 / 58%);
  display: grid;
  inset: 0;
  padding: 1rem;
  position: fixed;
}

[data-slot="dialog-panel"] {
  background: var(--tng-semantic-background-surface);
  border: 1px solid var(--tng-semantic-border-subtle);
  border-radius: 1rem;
  box-shadow: 0 24px 56px rgb(2 6 23 / 28%);
  display: grid;
  gap: 0.85rem;
  inline-size: min(100%, var(--tng-dialog-width, 34rem));
  padding: 1rem;
}

[data-slot="dialog-content"] {
  display: grid;
  gap: 0.75rem;
  max-block-size: min(52vh, 24rem);
  overflow: auto;
}

[data-slot="dialog-actions"] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  justify-content: flex-end;
}

[data-slot="dialog-close"],
[data-slot="dialog-trigger"] {
  border-radius: 0.75rem;
}

Owner guidance

  • Keep the backdrop and panel styling local to the dialog shell so modal contrast stays consistent.
  • Size the panel from the slot hooks instead of hard-coding widths on inner content wrappers.
  • Use shell CSS variables or local classes for product-specific panel dimensions.
  • Prefer styling focus states on your trigger and action buttons directly; the primitive only manages the behavior.