Password Field
Usage
Password Field is a masked input for passwords, secrets, or other credential input that can optionally reveal its value when users need to confirm briefly what they typed. Use it in sign-in, account setup, or credential update flows.
import { MtPasswordField } from "@shopware-ag/meteor-component-library";
Examples
Disabled
Error
Hint
API reference
Props
| Prop | Type | Default |
|---|---|---|
label | string | null | null |
placeholder | string | "" |
disabled | boolean | |
error | { code: number; detail: string; } | null | null |
hint | string | null | null |
toggable | boolean | true |
name | string | undefined |
required | boolean | false |
help-text | string | "" |
size | "default" | "small" | "default" |
is-inherited | boolean | false |
is-inheritance-field | boolean | false |
disable-inheritance-toggle | boolean | false |
id-suffix | string | "" |
model-value | string |
Events
| Event | Payload |
|---|---|
update:modelValue | [value: string | undefined] |
change | [value: string | undefined] |
inheritance-remove | [value: unknown] |
inheritance-restore | [value: unknown] |
submit | [] |
Slots
| Slot | Bindings |
|---|---|
prefix | any |
suffix | any |
hint | any |
Best practices
Do
- Use a clear label such as
PasswordorNew password. - Add help text or hint content when users need password rules.
- Keep the visibility toggle enabled when it helps users avoid typing mistakes.
Don't
- Do not use Password Field for non-sensitive text.
- Do not rely on placeholder text as the only instruction.
- Do not hide password requirements if the field enforces them.
Behavior
- Password Field masks input by default and can reveal the value with the visibility toggle when
toggableis enabled. - The component supports shared field patterns such as
hint,helpText,error, and inheritance handling. - It emits
submiton Enter, which can help in credential flows.
Accessibility
- Always provide a visible label so users know what credential is expected.
- Make sure the show or hide password control has a clear accessible name, especially if the field appears more than once on a page.
Related components
- Text Field: when the value is not sensitive and does not need reveal behavior.