ConfirmWrapper
"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.
<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
All props accepted by this component, with their type, default value and 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
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: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
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
| Key | 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.
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.
- 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.
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
Email confirmation
Horizontal layout