Component

Password input

<DomPasswordInput>

A styled password field with show/hide control, strength feedback, and an optional compromised-password warning.

Playground

Try every prop live

Password input playground

Toggle the compromised state to preview breach messaging.

Okay password (Time to crack: 2 thousand years)

Use a strong password.

Playground.vuevue
<script setup>
import { reactive } from 'vue';
import { DomPasswordInput } from '@getdom/studio/vue';

const data = reactive({
	  "modelValue": "correct-horse",
	  "id": "",
	  "name": "",
	  "label": "Create password",
	  "description": "Use a strong password.",
	  "placeholder": "Enter password",
	  "required": false,
	  "disabled": false,
	  "readOnly": false,
	  "invalid": false,
	  "errors": {},
	  "visible": true,
	  "validators": [],
	  "validateOnBlur": true,
	  "chrome": "field",
	  "showStrength": true,
	  "compromised": false,
	  "checkCompromised": false,
	  "compromisedCheckDelay": 600,
	  "compromisedMessage": "This password appears in known breaches. Choose a different password."
	});
</script>

<template>
	<DomPasswordInput
		v-bind="data"
		@update:modelValue="data.modelValue = $event"
	/>
</template>

Demo

Strength and breach warning

The field keeps the native input behaviour, with a visibility toggle and lightweight strength scoring.

Okay password (Time to crack: 2 thousand years)

Use at least 12 characters, with a mix of symbols and numbers.

Signup.vuevue
<script setup>
import { ref } from 'vue';
import { DomPasswordInput } from '../../../lib/vue';

const password = ref('correct-horse');
</script>

<template>
	<div class="w-full max-w-sm">
		<DomPasswordInput
			v-model="password"
			label="Create password"
			description="Use at least 12 characters, with a mix of symbols and numbers."
			placeholder="Choose a password"
			:check-compromised="true"
		/>
	</div>
</template>

Reference

Props

Control props

NameTypeTSDefaultDescription
labelstringstring'Password'Visible field label.
descriptionstringstring''Optional helper copy below the label.
placeholderstringstring'Enter password'Placeholder text shown before entry.
showStrengthbooleanbooleantrueShow a strength meter below the field.
compromisedbooleanbooleanfalseShow a warning when the current password has been found in a breach.
checkCompromisedbooleanbooleanfalseCheck the password against the Have I Been Pwned Pwned Passwords API.
compromisedCheckDelaynumbernumber600Delay in milliseconds before checking the Pwned Passwords API after typing.
compromisedMessagestringstring'This password appears in known breaches. Choose a different password.'Warning copy shown when compromised is true.

Field props

NameTypeTSDefaultDescription
modelValueanyany''Current field value.
idstringstring''Optional ID override. By default parent forms derive the input ID from the field path using underscores.
namestringstring''Local field name. Parent forms derive the full field path and native HTML name from the form hierarchy.
requiredbooleanbooleanfalseMark the field as required.
disabledbooleanbooleanfalseDisable field interaction.
readOnlybooleanbooleanfalseShow the value but prevent editing.
invalidbooleanbooleanfalseMark the field invalid.
errors
[
	{
		name: "Validation name",
		message: "Error message",
	}
]
array | object | stringArray<ErrorsItem
type ErrorsItem = {
	name?: string; // Name
	message?: string; // Message
};
>
{}Validation errors for this field.
visiblebooleanbooleantrueShow or hide the field.
validatorsarrayArray<unknown>[]Validators attached to this field. Use functions in Vue code, or serializable records such as { name: "minLength", props: { min: 2 } } in generated schemas.
validateOnBlurbooleanbooleantrueRun validators when the field loses focus.
chrome'field' | falsestring'field'Render default field chrome, or false to render only the control while keeping form state wiring.

Auto-generated from Password input.props and inline _edit hints.

Events

NamePayloadDescription
@update:modelValuestringFired when the password text changes.
@focus
@blur

Names auto-detected from defineEmits and source emit() calls; payload and description from __doc.events when present.