ConfirmWrapper

Form & Input
stable

"Type-it-twice" form helper that pairs a primary input with a confirmation input and validates that both values match.

Structure

Anatomy

Visual breakdown of the component's internal structure with BEM class call-outs.

Anatomy of OrigamConfirmWrapperSchematic of the ConfirmWrapper component with numbered internal parts. 1 origam-confirm-wrapper 2 Header — prepend / title / append 3 #default — Primary input field 4 #confirm — Confirmation input field 5 Details — messages / hint / counter
Anatomy of <origam-confirm-wrapper> — 5 regions. The wrapper coordinates validation between the #default and #confirm slots, surfacing match errors in the details zone.
1.origam-confirm-wrapper
Root element. Manages shared validation state between the two inner inputs.
2.origam-confirm-wrapper__header
Optional header row. Contains prepend, title and append sub-elements. Hidden when no header content is provided.
3.origam-confirm-wrapper__field
Primary input container. The #default slot renders here.
4.origam-confirm-wrapper__confirm
Confirmation input container. The #confirm slot renders here.
5.origam-confirm-wrapper__details
Details row. Shows hint, messages and match-error text. Height governed by --origam-confirm-wrapper---details-min-height.

API

Props

All props accepted by this component, with their type, default value and description.

modelValue
any
Value of the primary input (v-model).
confirm
any
Value of the confirmation input (v-model:confirm). Validation passes when it equals modelValue.
field
string
Field name used in error messages, e.g. "password".
defaults
Record<string, any>
Default prop overrides forwarded to both inner input components.
confirmLabel
string
Label for the confirmation input field.
disabled
boolean
false
Disables both the primary and confirmation inputs.
readonly
boolean
false
Makes both inputs non-interactive without visually disabling them.
required
boolean
false
Marks both fields as required.
error
boolean
false
Forces the error visual state on both inputs.
errorMessages
string | string[]
Custom error messages shown below the fields.
hideDetails
boolean | 'auto'
false
Hides the hint/error messages area. 'auto' hides when there is nothing to show.
messages
string | string[]
Informational messages shown below the fields (non-error).
hint
string
Helper text shown below the field.
persistentHint
boolean
false
Always shows the hint, even when the field is not focused.
centerAffix
boolean
Vertically centres the prepend/append icons within the field height.
label
string
Label for the primary input field.
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
appendAvatar
string
appendIcon
Icon displayed in the append slot of the header.
prependAvatar
string
prependIcon
Icon displayed in the prepend slot of the header.
prependAriaLabel
string
appendAriaLabel
string
direction
TDirection
'vertical'
Stacks the primary and confirmation inputs vertically or side by side.
color
Intent or custom colour for the active/focused state of both inputs.
density
'default'
Adjusts vertical padding density for both inputs.
Border-radius token forwarded to both input fields.
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
elevation
TElevation
Box-shadow elevation forwarded to both input fields.
variant
'outlined'
Visual style variant forwarded to both input fields (outlined, filled, plain, underlined, solo…).
focused
boolean

API

Slots

Content slots exposed by this component.

#default
Primary input slot. Renders the first field (e.g. a PasswordField or TextField).
#confirm
Confirmation input slot. Renders the second field that must match the primary.
#header
Optional header area rendered above both fields. Contains prepend / title / append.
#title
Custom title inside the header area.
#messages
Custom messages block (replaces the default messages/errors area).
#message
Custom renderer for a single message entry.
#details
Custom details area below the fields (hint, counter, messages).
#prepend
#append

API

Emits

Events emitted by this component.

@update:confirm
any
Fired when the confirmation input value changes.
@update:modelValue
any
Fired when the primary input value changes.
@click:append
MouseEvent
@focus
FocusEvent
Fired when either input receives focus.
@click:prepend
MouseEvent
@blur
FocusEvent
Fired when either input loses focus.

API

Exposed members

Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.

<T extends object>(props: T, exclude?: string[]) => Partial<T>
Utility to forward a filtered subset of props to child components.
() => Promise<boolean>
Triggers validation of both fields. Resolves to true when values match and all rules pass.
() => void
Resets both input values and clears validation state.
() => void
Clears validation messages without resetting values.
Ref<string>
Reactive CSS string generated by useStyle for the injected style sheet.
string
Unique style-sheet ID for this instance.
() => void
Injects the computed style sheet into the document. Called automatically on mount.
() => void
Removes the injected style sheet. Called automatically on unmount.
Ref<boolean>
True once the style sheet has been injected into the DOM.

Customisation

CSS variables

CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.

Inline-start (left in LTR) padding of the wrapper.
Inline-end (right in LTR) padding of the wrapper.
Block-start padding of the wrapper.
Block-end padding of the wrapper.
Minimum height of the details row to prevent layout shift when messages appear.
Gap between primary and confirmation fields in horizontal direction mode.
Error text color rendered in the details row when values do not match.

Inclusion

Accessibility

ARIA roles, keyboard navigation and focus management. Sourced from the real component template.

Keyboard interactions

Keyboard interactions
KeyAction
TabMoves focus from the primary input to the confirmation input, then to the next focusable element.

Notes

  • When validation fails (values do not match), the error message is associated with the confirmation field via aria-describedby. The confirmation input receives aria-invalid="true".
  • When required=true, aria-required="true" is forwarded to both inner inputs.

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
dimension
var(--origam-space---4)
Block-end padding of the wrapper.
dimension
22px
Minimum height of the details row.
dimension
1em
Gap between fields in horizontal mode.
color
var(--origam-color__feedback--danger---fgSubtle)
Error text color when values do not match.
number
var(--origam-opacity---50)
Opacity applied to both fields when disabled.

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.

Password confirmation

vue

Email confirmation

vue

Horizontal layout

vue