Messages
Accessible live region that displays a list of validation or hint messages below form fields. Supports transitions, custom slot content, and full design token customisation.
Structure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<origam-messages> — 3 parts: the root live-region container, and one __message row per entry in the messages array.- 1.origam-messages
- Root container. Has aria-live="polite" and role="status" for screen-reader announcements.
- 2.origam-messages__message (row 1)
- First message row. Enters/leaves with the slide-y transition.
- 3.origam-messages__message (row n)
- Subsequent message rows — one per entry in the messages array.
API
Props
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et description.
- activebooleanfalse
- When true, the messages container is visible. Controls the v-show and transition entry.
- messagesArray<string> | string[]
- One or more message strings to display. Each string is rendered as a separate row (origam-messages__message).
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- tagstring'div'
- Root HTML tag rendered for the messages container.
- transitionboolean | string | TTransitionProps'slide-y-transition'
- Enter/leave transition applied to each message row. Defaults to the slide-y-transition.
- color
- Text color applied to all message rows.
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>false
- Applies a border to the container. Pass true for the default or a CSS shorthand.
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderColorstring
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- paddingboolean | number | string
- Inner padding override.
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- marginboolean | number | string
- Outer margin override.
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- Border-radius token applied to the container.
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- Adjusts the vertical padding/spacing density.
- elevationTElevation
- Box-shadow elevation applied to the messages container.
- fontSizeTFontSize
- lineHeightTLineHeight
API
Slots
Emplacements de contenu exposés par ce composant.
- #default
- Custom renderer for each individual message row. Receives the message string. By default renders the message as plain text.
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.
- Default message text color. Inherits from the parent context (OrigamField injects the error/hint color).
- Font size of all message rows (fixed 12 px per spec).
- Minimum height preserved even with no messages, preventing layout jump.
- Container opacity.
- Duration of the slide-y enter/leave transition per message row.
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 element carries aria-live="polite" and role="status". Screen readers announce new messages without interrupting the current speech flow.
- Color alone is never the sole indicator — message text is always visible. Ensure sufficient contrast ratio (≥4.5:1) when overriding the color prop.
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.
- colorcurrentColor
- Inherits the field context color (error=danger, hint=info).
- dimension12px
- Fixed 12 px per design spec.
- dimension14px
- Prevents layout collapse when messages array is empty.
- durationvar(--origam-motion__duration---normal)
- Slide-y transition duration for individual message rows.
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.
Basic messages
Hint message
Custom slot