Messages

Form & Input
stable

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.

Anatomy of OrigamMessagesSchematic of the Messages component with 3 numbered parts. origam-messages__message — "This field is required" origam-messages__message — "Must be a valid email" 1 2 3
Anatomy of <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.

active
boolean
false
When true, the messages container is visible. Controls the v-show and transition entry.
messages
Array<string> | string
[]
One or more message strings to display. Each string is rendered as a separate row (origam-messages__message).
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
tag
string
'div'
Root HTML tag rendered for the messages container.
transition
boolean | 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.
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
false
Applies a border to the container. Pass true for the default or a CSS shorthand.
borderTop
boolean | number | string
borderLeft
boolean | number | string
borderBottom
boolean | number | string
borderRight
boolean | number | string
borderBlock
boolean | number | string
borderInline
boolean | number | string
borderInlineStart
boolean | number | string
borderInlineEnd
boolean | number | string
borderBlockStart
boolean | number | string
borderBlockEnd
boolean | number | string
borderColor
string
borderStyle
string
borderTopColor
TColor
borderRightColor
TColor
borderBottomColor
TColor
borderLeftColor
TColor
borderInlineStartColor
TColor
borderInlineEndColor
TColor
borderBlockStartColor
TColor
borderBlockEndColor
TColor
padding
boolean | number | string
Inner padding override.
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
margin
boolean | number | string
Outer margin override.
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
Border-radius token applied to the container.
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
density
'default'
Adjusts the vertical padding/spacing density.
elevation
TElevation
Box-shadow elevation applied to the messages container.
fontSize
TFontSize
lineHeight
TLineHeight

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

status

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.

Source
color
currentColor
Inherits the field context color (error=danger, hint=info).
dimension
12px
Fixed 12 px per design spec.
dimension
14px
Prevents layout collapse when messages array is empty.
duration
var(--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

vue

Hint message

vue

Custom slot

vue