InputField

A versatile text input component with support for various HTML5 types, error states, and a built-in password visibility toggle.

Install: pnpm add-component Fields/InputField

Basic inputs

Standard text and email inputs with labels and placeholders.

Password with toggle

Setting type to "password" automatically adds a visibility toggle icon.

Password strength

The meter says the level in words as well as colour, and each rule reads "Done" or "Not yet" with an icon. Scoring is a pure function, scorePassword(value, rules), exported from InputField: no zxcvbn. Until every rule holds, the level stops at Fair. In AppForm: { type: "password", strength: true }.

Custom password rules

Rules are { label, test } pairs. A passphrase policy might ask for length and words instead of symbols.

Number & date

Supports numeric values and native date-time pickers.

Validation states

Display helpful error messages to guide the user.

Readonly / disabled

Use the readonly prop for non-editable fields.

Immediate correcting validation

See how errors disappear instantly as you type valid data, powered by the useFormValidation composable.

API