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

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

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

Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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

Emplacements de contenu exposés par ce composant.

#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

Événements émis par ce composant.

@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

Membres exposés

Propriétés et méthodes accessibles via ref template (defineExpose). Utilisés pour le contrôle programmatique.

<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.

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.

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

Accessibilité

Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.

Interactions clavier

Interactions clavier
ToucheAction
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.

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.

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.

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.

Password confirmation

vue

Email confirmation

vue

Horizontal layout

vue