Skip to content

OrigamMessages ​

<OrigamMessages> renders a list of validation or hint messages below a form field. Each message is wrapped in an origam-messages__message div and the container has aria-live="polite" + role="status" for screen-reader support.

Messages animate in/out with a slide-Y transition by default.

Basic usage ​

vue
<template>
    <OrigamMessages :messages="['This field is required.']" />
</template>

Multiple messages ​

messages accepts a single string or an array of strings.

vue
<template>
    <OrigamMessages :messages="['Too short.', 'Must contain a number.']" />
</template>

Custom slot ​

Use the default slot to customise how each message is rendered.

vue
<template>
    <OrigamMessages :messages="errors">
        <template #default="{ message }">
            <span class="my-error">{{ message }}</span>
        </template>
    </OrigamMessages>
</template>

Color ​

vue
<template>
    <OrigamMessages color="danger" :messages="['Invalid value.']" />
</template>

Elevation ​

elevation (from IElevationProps) drops a shadow under the message block. It accepts the origam rungs (none · xs · sm · md · lg · xl · 2xl · 3xl), a Material level (0…24, mapped onto the same ladder), or a free-form box-shadow string passed through verbatim.

The component emits both channels: the origam-messages--elevated state class plus the .origam--shadow-{rung} utility when the rung has one, and the box-shadow: var(--origam-shadow---{rung}) declaration that actually paints.

vue
<template>
    <OrigamMessages elevation="md" :messages="['Saved.']" />
    <OrigamMessages :elevation="8" :messages="['Saved.']" />
    <OrigamMessages elevation="0 4px 12px rgba(0,0,0,.24)" :messages="['Saved.']" />
</template>

Slots ​

SlotScopeDescription
default{ message: string }Custom render for each message string

Props — Typography ​

These props override the matching CSS variable via an inline custom property. Each prop targets the surface that reads the corresponding token.

PropTypeValuesCSS variable overriddenSurface
fontSizeTFontSizexs · sm · md · lg · xl · 2xl · 3xl · 4xl · 5xl--origam-messages---font-sizecontainer root
lineHeightTLineHeightnone · tight · snug · normal · relaxed · loose--origam-messages__message---line-heighteach __message child

Tokens ​

VariableDefaultUsed for
--origam-messages---colorcurrentColormessage text colour
--origam-messages---font-size12pxmessage font size
--origam-messages---min-height14pxcontainer min-height
--origam-messages---min-width1pxcontainer min-width
--origam-messages---opacity0.87container opacity
--origam-messages---flex1 1 autoflex grow/shrink
--origam-messages__message---line-height12pxmessage line height
--origam-messages__message---transition-duration0.15sslide animation speed

Caveats ​

  • active has no effect (#550, critère C1). Visibility of the transition is driven entirely by messages being non-empty, never by this prop — wiring a fake "run the transition on mount" behaviour was rejected the same way it was on the Chart family (#426/#545 decision): neither inventing a behaviour nor silently removing a prop a consumer's type may already reference was on the table. Passing active (any value, including false) logs [origam] <OrigamMessages> prop "active" has no effect on this component: visibility is driven by \messages` being non-empty, never by this prop.` once to the console in dev builds (silent in production).