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.
Aperçu
Rendu de l’aperçu en cours…
defaultRendu de l’aperçu en cours…
strength barRendu de l’aperçu en cours…
tilesRendu de l’aperçu en cours…
minimalStructure
Anatomie
Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.
<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
Toutes les props acceptées par ce composant, avec leur type, valeur par défaut et 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
Emplacements de contenu exposés par ce composant.
- #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
Événements émis par ce composant.
- @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
Personnalisation
Variables CSS
Propriétés CSS personnalisées exposées par ce composant. Surchargez-les pour personnaliser sans perdre la compatibilité avec le thème.
- 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
Accessibilité
Rôles ARIA, navigation clavier et gestion du focus. Sourcé depuis le template réel du composant.
Rôles ARIA
Interactions clavier
| Touche | 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.
Fondation
Design tokens
Extrait des tokens de ce composant — les variables --origam-<composant>---<propriété>, déclarées dans sa feuille de tokens tenue à la main, sans étape de build.
- number0.2
- Default icon opacity (unmet requirement).
Interactif
Playground
Modifiez les props en direct et observez le composant se mettre à jour. Le snippet de code généré suit vos changements.
Rendu de l’aperçu en cours…
Usage
Exemples
Extraits de code prêts à coller dans vos templates.
Basic
With requirements checklist
Tiles layout