ConfirmWrapper
"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.
<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
#defaultslot renders here. - 4.origam-confirm-wrapper__confirm
- Confirmation input container. The
#confirmslot 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.
- modelValueany
- Value of the primary input (v-model).
- confirmany
- Value of the confirmation input (v-model:confirm). Validation passes when it equals modelValue.
- fieldstring
- Field name used in error messages, e.g. "password".
- defaultsRecord<string, any>
- Default prop overrides forwarded to both inner input components.
- confirmLabelstring
- Label for the confirmation input field.
- disabledbooleanfalse
- Disables both the primary and confirmation inputs.
- readonlybooleanfalse
- Makes both inputs non-interactive without visually disabling them.
- requiredbooleanfalse
- Marks both fields as required.
- errorbooleanfalse
- Forces the error visual state on both inputs.
- errorMessagesstring | string[]
- Custom error messages shown below the fields.
- hideDetailsboolean | 'auto'false
- Hides the hint/error messages area. 'auto' hides when there is nothing to show.
- messagesstring | string[]
- Informational messages shown below the fields (non-error).
- hintstring
- Helper text shown below the field.
- persistentHintbooleanfalse
- Always shows the hint, even when the field is not focused.
- centerAffixboolean
- Vertically centres the prepend/append icons within the field height.
- labelstring
- Label for the primary input field.
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- appendAvatarstring
- appendIcon
- Icon displayed in the append slot of the header.
- prependAvatarstring
- prependIcon
- Icon displayed in the prepend slot of the header.
- prependAriaLabelstring
- appendAriaLabelstring
- directionTDirection'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.
- Adjusts vertical padding density for both inputs.
- Border-radius token forwarded to both input fields.
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- elevationTElevation
- Box-shadow elevation forwarded to both input fields.
- Visual style variant forwarded to both input fields (outlined, filled, plain, underlined, solo…).
- focusedboolean
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:confirmany
- Fired when the confirmation input value changes.
- @update:modelValueany
- Fired when the primary input value changes.
- @click:appendMouseEvent
- @focusFocusEvent
- Fired when either input receives focus.
- @click:prependMouseEvent
- @blurFocusEvent
- 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
| Touche | Action |
|---|---|
| Tab | Moves 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.
- dimensionvar(--origam-space---4)
- Block-end padding of the wrapper.
- dimension22px
- Minimum height of the details row.
- dimension1em
- Gap between fields in horizontal mode.
- colorvar(--origam-color__feedback--danger---fgSubtle)
- Error text color when values do not match.
- numbervar(--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
Email confirmation
Horizontal layout