EmptyState
Placeholder shown when a list, table or collection has nothing to display. Five visual presets (no-data, no-results, error, offline, locked) bundle icon + intent; both are overridable via props or slots.
Preview
Rendering the live preview…
no-dataRendering the live preview…
no-resultsRendering the live preview…
errorRendering the live preview…
offlineRendering the live preview…
lockedStructure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-empty-state> — 5 internal parts. The root ① carries role="status" and aria-live="polite"; each section is conditionally rendered.- 1.origam-empty-state
- Root element. Has role="status" aria-live="polite". Flex column. Width 100%.
- 2.origam-empty-state__icon
- Icon container. aria-hidden="true". Contains OrigamIcon or the #icon slot.
- 3.origam-empty-state__title
- Title element. Rendered when the title prop or the #title slot is present.
- 4.origam-empty-state__description
- Description element. Width clamped by --origam-empty-state---max-width (480px default). Rendered when description prop or #description slot is present.
- 5.origam-empty-state__actions
- Actions row. Inline-flex with wrap. Rendered only when the #actions slot is provided.
API
Props
All props accepted by this component, with their type, default value and description.
- Visual preset. Bundles a default icon and intent. Values: 'no-data' | 'no-results' | 'error' | 'offline' | 'locked'. Override icon/iconColor to customise.
- titlestring
- Primary heading rendered below the icon. Override with the #title slot for richer markup.
- descriptionstring
- Optional sub-heading rendered below the title. Width is clamped by --origam-empty-state---max-width.
- icon
- Override the preset icon. Accepts an MDI string, a SVG path array, or a Vue component. Use the #icon slot for full SVG illustrations.
- iconColor
- Override the preset intent colour for the icon. Accepts semantic intent values (primary, success, danger…).
- Vertical density. Values: 'sm' | 'md' | 'lg'. Drives icon size, font sizes, padding and gap.
- Horizontal alignment of the icon / title / description / actions stack. Values: 'center' | 'left'.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- tagstring'div'
- HTML element rendered at the root.
- fontSizeTFontSize
- fontWeightTFontWeight
- lineHeightTLineHeight
- fontFamilyTFontFamily
API
Slots
Content slots exposed by this component.
- #default
- Replaces the entire built-in layout (icon + title + description + actions). Use for fully bespoke placeholder markup.
- #icon
- Replaces the default OrigamIcon render. Use for SVG / <img> illustrations. Mark as aria-hidden="true" when purely decorative.
- #title
- Replaces the rendered title element. Slot wins over the title prop when both are provided.
- #description
- Replaces the rendered description element. Slot wins over the description prop.
- #actions
- Actions row rendered below the description. Typically holds 1–2 buttons (Create, Retry, Sign in…).
API
Exposed members
Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.
- ComputedRef<TIcon>
- The resolved icon: user icon prop wins over preset default.
- ComputedRef<TIntent>
- The resolved intent: user iconColor prop wins over preset default.
- ComputedRef<boolean>
- True when the default slot is provided — replaces the built-in layout entirely.
- ComputedRef<boolean>
- True when a title prop or #title slot is present.
- ComputedRef<boolean>
- True when a description prop or #description slot is present.
- ComputedRef<boolean>
- True when the #actions slot is provided.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- Block padding of the root element. Per-size variants override this value.
- Inline padding of the root element.
- Flex gap between icon, title, description and actions. Per-size overrides apply.
- Maximum width of the description text for readable line length.
- Icon font-size / size. Overridden per size class (sm=48px, md=64px, lg=96px).
- Icon colour. Overridden per intent modifier class (e.g. --intent-danger maps to danger feedback colour).
- Title font size. Overridden per size class.
- Description font size. Overridden per size class.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Notes
- The root has role="status" and aria-live="polite". Screen readers announce the state change when the component appears or when preset changes without a page reload.
- The icon container carries aria-hidden="true" — it is decorative. The meaningful information is in the title and description text nodes.
- Actions inside the #actions slot must individually carry correct roles (button, link). EmptyState does not wrap or intercept keyboard events.
Foundation
Design tokens
Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.
- dimensionvar(--origam-space---10)
- Block padding for size=md (40px).
- dimensionvar(--origam-space---4)
- Gap between sections for size=md (16px).
- dimension480px
- Max width of the description text zone.
- dimension64px
- Icon size for size=md.
- dimensionvar(--origam-font__size---xl)
- Title font size for size=md (1.25rem).
- colorvar(--origam-color__text---secondary)
- Description text colour.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Presets
With actions
Custom icon slot