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
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<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
All props accepted by this component, with their type, default value and 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
Content slots exposed by this component.
- #default
- Custom renderer for each individual message row. Receives the message string. By default renders the message as plain text.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- 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
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
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.
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.
- 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.
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.
Basic messages
Hint message
Custom slot