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.
Aperçu
Rendu de l’aperçu en cours…
no-dataRendu de l’aperçu en cours…
no-resultsRendu de l’aperçu en cours…
errorRendu de l’aperçu en cours…
offlineRendu de l’aperçu en cours…
lockedStructure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
Emplacements de contenu exposés par ce composant.
- #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
Membres exposés
Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.
- 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.
Personnalisation
Variables CSS
Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.
- 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
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Rôles ARIA
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.
Fondation
Design tokens
Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.
- 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.
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Presets
With actions
Custom icon slot