PasswordField
Secure password input with show/hide toggle, 4-segment strength bar, and a requirements checklist (list or tile layout). Automatically injects validation rules for enabled requirements.
Preview
Rendering the live preview…
defaultRendering the live preview…
strength barRendering the live preview…
tilesRendering the live preview…
minimalStructure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-password-field> — 7 parts: field input, show/hide toggle, strength bar, requirements list container, and individual requirement items.- 1.origam-password-field
- Root OrigamTextField wrapper with type="password" wiring.
- 2.origam-password-field__toggle-icon
- Show/hide toggle button in the appendInner slot. Icon swaps between onIcon and offIcon.
- 3.origam-password-field__strength
- 4-segment strength bar. Visible when strengthBar=true. Segments fill based on computed level.
- 4.origam-password-field__inline-footer
- Container rendered in the details slot, hosting the strength bar and requirements list.
- 5.origam-password-field__requirements
- Requirements list container. Modifier --list or --tiles controls the layout.
- 6.origam-password-field__item
- Individual requirement row or tile. Gets --valid modifier when the predicate passes.
- 7.origam-password-field__requirement-icon
- Check or cross icon for each requirement. Opacity: 0.2 (unmet) → 1 (met).
API
Props
All props accepted by this component, with their type, default value and description.
- Icon shown when the password is HIDDEN (click reveals it).
- Icon shown when the password is VISIBLE (click hides it).
- maxlengthnumber
- Native maxlength attribute. Mirrored into the requirements popup when displayed.
- requirementsbooleanfalse
- Enables the strength-requirements popup / checklist. When false, the field behaves exactly like a plain TextField with type="password".
- persistentRequirementsbooleanfalse
- Keeps the requirements popup open even when the field is not focused.
- minLengthnumber8
- Minimum password length. Drives the minLength validation rule when requirements=true.
- needTinybooleanfalse
- Require at least one lowercase letter.
- needUppercasebooleanfalse
- Require at least one uppercase letter.
- needNumberbooleanfalse
- Require at least one digit.
- needSpecialbooleanfalse
- Require at least one non-alphanumeric character.
- menuProps
- Props forwarded to the internal OrigamMenu (location, delays, offset…).
- menuboolean
- strengthBarbooleanfalse
- Shows a 4-segment bar under the input that fills as password strength increases (weak → fair → good → strong).
- requirementRulesIPasswordRequirement[]
- Custom checklist predicates. Each { id, label, test(value) } entry renders a row or tile. Falls back to DEFAULT_PASSWORD_REQUIREMENTS when undefined and requirements=true.
- requirementsLayout'list' | 'tiles''list'
- Layout for the requirements checklist: list (vertical ul) or tiles (Chip pills).
- minimalbooleanfalse
- Strips all decorations: toggle eye, strength bar, requirements. Useful for confirm-password fields.
- autofocusboolean
- counterboolean | number | string
- counterValuenumber | ((e: any) => number)
- placeholderstring
- persistentPlaceholderboolean
- persistentCounterboolean
- rolestring
- typeTTextFieldType
- modelModifiersstring | boolean
- maskTMask
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- colorTColor
- densityTDensity
- centerAffixboolean
- dirtyboolean
- disabledbooleanfalse
- Disables the field and the toggle icon.
- errorstring | boolean
- inlineboolean
- labelstring
- Floating label text.
- prefixstring
- suffixstring
- persistentClearboolean
- singleLineboolean
- requiredboolean
- loadingTControlLoadingValue
- tagstring
- loadingTextstring
- bgColorTColor
- appendInnerAvatarstring
- appendInnerIconTIcon
- prependInnerAvatarstring
- prependInnerIconTIcon
- clearIconTIcon
- clearableboolean
- prependInnerAriaLabelstring
- appendInnerAriaLabelstring
- borderboolean | number | string | TDirectionBoth | Array<TDirectionBoth>
- borderTopboolean | number | string
- borderLeftboolean | number | string
- borderBottomboolean | number | string
- borderRightboolean | number | string
- borderBlockboolean | number | string
- borderInlineboolean | number | string
- borderInlineStartboolean | number | string
- borderInlineEndboolean | number | string
- borderBlockStartboolean | number | string
- borderBlockEndboolean | number | string
- borderColorstring
- borderStylestring
- borderTopColorTColor
- borderRightColorTColor
- borderBottomColorTColor
- borderLeftColorTColor
- borderInlineStartColorTColor
- borderInlineEndColorTColor
- borderBlockStartColorTColor
- borderBlockEndColorTColor
- focusedboolean
- textstring
- floatingboolean
- namestring
- marginboolean | number | string
- marginTopboolean | number | string
- marginLeftboolean | number | string
- marginBottomboolean | number | string
- marginRightboolean | number | string
- marginBlockboolean | number | string
- marginInlineboolean | number | string
- marginInlineStartboolean | number | string
- marginInlineEndboolean | number | string
- marginBlockStartboolean | number | string
- marginBlockEndboolean | number | string
- paddingboolean | number | string
- paddingTopboolean | number | string
- paddingLeftboolean | number | string
- paddingBottomboolean | number | string
- paddingRightboolean | number | string
- paddingBlockboolean | number | string
- paddingInlineboolean | number | string
- paddingInlineStartboolean | number | string
- paddingInlineEndboolean | number | string
- paddingBlockStartboolean | number | string
- paddingBlockEndboolean | number | string
- roundedboolean | number | string | TRounded | null | undefined
- roundedTopRightboolean | number | string
- roundedTopLeftboolean | number | string
- roundedBottomLeftboolean | number | string
- roundedBottomRightboolean | number | string
- roundedStartStartboolean | number | string
- roundedStartEndboolean | number | string
- roundedEndStartboolean | number | string
- roundedEndEndboolean | number | string
- fontSizeTFontSize
- fontWeightTFontWeight
- lineHeightTLineHeight
- letterSpacingTLetterSpacing
- activeboolean | IStateEffectConfig
- activeClassstring
- Visual variant (outlined, filled, underlined, solo, plain).
- elevationTElevation
- sizeTSize | number
- hideDetailsboolean | string
- hideSpinButtonsboolean
- hintstring
- persistentHintboolean
- messagesArray<string> | string
- heightnumber | string
- maxHeightnumber | string
- maxWidthnumber | string
- minHeightnumber | string
- minWidthnumber | string
- widthnumber | string
- directionTDirection
- errorMessagesArray<string> | string
- maxErrorsnumber | string
- readonlybooleanfalse
- Makes the field read-only.
- rulesArray<any>[]
- Form validation rules. Required-based rules (needTiny, needUppercase…) are auto-injected when requirements=true.
- modelValueany
- Current password value. Use v-model to bind two-way.
- validateOnTValidateOn
- validationValueany
- appendAvatarstring
- appendIconTIcon
- prependAvatarstring
- prependIconTIcon
- prependAriaLabelstring
- appendAriaLabelstring
API
Slots
Content slots exposed by this component.
- #info
- Overrides the requirements popup body. Receives the requirement state map.
- #counter
- Custom counter renderer in the details slot.
- #field
- Replaces the entire field control (advanced override).
- #default
- #loader
- Custom loading indicator.
- #label
- Custom label content replacing the default floating label.
- #floatingLabel
- #prefix
- #suffix
- #prependInner
- Content placed inside the field, before the input.
- #appendInner
- #clear
- #details
- #prepend
- Content placed outside and before the field.
- #append
- Content placed outside and after the field.
- #messages
- #message
API
Emits
Events emitted by this component.
- @click:controlMouseEvent
- Fired when the show/hide toggle icon is clicked.
- @mousedown:controlMouseEvent
- Fired on pointerdown on the toggle icon.
- @update:strengthTPasswordStrengthLevel
- Fires when the computed strength level changes (weak | fair | good | strong). Supports v-model:strength.
- @update:focusedany
- @click:appendInnerMouseEvent
- @click:prependInnerMouseEvent
- @click:clearMouseEvent
- Fired when the clear button is clicked (clearable=true).
- @update:modelValueany
- Two-way binding for the password string value.
- @click:appendMouseEvent
- @click:prependMouseEvent
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- Transition applied to the input on show/hide toggle.
- Cursor style on the show/hide toggle wrapper.
- Opacity of the requirement glyph icon when not yet satisfied.
- Font size of the requirement glyph icon. Intentionally larger than standard scale.
- Segment background color for strength level "weak".
- Segment background color for strength level "fair".
- Segment background color for strength level "good".
- Segment background color for strength level "strong".
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Moves focus to the next interactive element (input → toggle icon). |
| Enter / Space (on toggle icon) | Reveals or hides the password. |
Notes
- The show/hide toggle is a button element with aria-label that changes between "Show password" and "Hide password" depending on state.
- The requirements popup opens with aria-haspopup="listbox" on the input. Each requirement item announces its state via a visually-hidden text or the icon's aria-hidden.
- The strength bar is visual only (aria-hidden). Strength feedback is conveyed via the requirements checklist and the update:strength emit, which the parent can use to show a text label.
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.
- number0.2
- Default icon opacity (unmet requirement).
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.
Basic
With requirements checklist
Tiles layout