Skip to content

TypedConfirmField ​

Overview ​

Anti-mistake confirmation field that gates a destructive action until the operator types the exact expectedValue. The default chrome is the canonical "type it to mean it" recipe: a bordered, muted-tinted box containing a small sans label with an inline mono chip showing the expected literal, followed by a mono text input.

Consumers read the match state via v-model:match (or the match event) and disable their submit control while it is false. The raw typed value is exposed via v-model for callers that need to inspect or echo it.

Theme entry: TypedConfirmField

Props ​

NameTypeRequiredDefaultDescription
themeOverrideObjectnullA partial ThemeObject keyed by component name, merged over this component's theme and provided to descendants.
expectedValuestringyesLiteral string the operator must type before the field reports a match.
modelValuestring""Typed value (v-model).
placeholderstringundefinedOptional placeholder; falls back to expectedValue when omitted.
labelLeadstring"Type"Lead-in text rendered before the expected-value chip in the default label.
labelTailstring"to confirm"Trailing text rendered after the expected-value chip in the default label.
inputIdstringundefinedExplicit DOM id for the input; defaults to a Vue-generated id and is forwarded to the wrapping label.
classimport('vue').HTMLAttributes['class']undefinedAdditional CSS classes applied to the root.

Slots ​

NameScopedDescription
labelyesOverride the label content. Default renders {labelLead} + an inline <code> chip + {labelTail}. Receives expectedValue and chipClass slot props.

Full slot reference

Events ​

NameDescription
update:modelValueEmitted on every keystroke with the latest typed value.
matchEmitted whenever the match state crosses; payload is true when the typed value equals expectedValue.

Full event reference

Source ​

client/lib/form/confirm/TypedConfirmField.vue