PasswordField

Form & Input
stable

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…

default

Rendu de l’aperçu en cours…

strength bar

Rendu de l’aperçu en cours…

tiles

Rendu de l’aperçu en cours…

minimal

Structure

Anatomie

Décomposition visuelle de la structure interne du composant avec les appels de classes BEM.

Anatomy of OrigamPasswordFieldSchematic of the PasswordField component with 7 numbered parts. Password •••••••• 👁 origam-password-field__item — "8+ characters" ✓ origam-password-field__item — "Uppercase letter" ○ origam-password-field__item — "Number" ○ 1 2 3 4 5 6 7
Anatomy of <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.

onIcon
mdi-eye-off
Icon shown when the password is HIDDEN (click reveals it).
offIcon
mdi-eye
Icon shown when the password is VISIBLE (click hides it).
maxlength
number
Native maxlength attribute. Mirrored into the requirements popup when displayed.
requirements
boolean
false
Enables the strength-requirements popup / checklist. When false, the field behaves exactly like a plain TextField with type="password".
persistentRequirements
boolean
false
Keeps the requirements popup open even when the field is not focused.
minLength
number
8
Minimum password length. Drives the minLength validation rule when requirements=true.
needTiny
boolean
false
Require at least one lowercase letter.
needUppercase
boolean
false
Require at least one uppercase letter.
needNumber
boolean
false
Require at least one digit.
needSpecial
boolean
false
Require at least one non-alphanumeric character.
menuProps
Props forwarded to the internal OrigamMenu (location, delays, offset…).
menu
boolean
strengthBar
boolean
false
Shows a 4-segment bar under the input that fills as password strength increases (weak → fair → good → strong).
requirementRules
IPasswordRequirement[]
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).
minimal
boolean
false
Strips all decorations: toggle eye, strength bar, requirements. Useful for confirm-password fields.
autofocus
boolean
counter
boolean | number | string
counterValue
number | ((e: any) => number)
placeholder
string
persistentPlaceholder
boolean
persistentCounter
boolean
role
string
type
TTextFieldType
modelModifiers
string | boolean
mask
TMask
id
string
class
string | Array<string> | object
style
string | Array<string> | object | StyleValue
color
TColor
density
TDensity
centerAffix
boolean
dirty
boolean
disabled
boolean
false
Disables the field and the toggle icon.
error
string | boolean
inline
boolean
label
string
Floating label text.
prefix
string
suffix
string
persistentClear
boolean
singleLine
boolean
required
boolean
loading
TControlLoadingValue
tag
string
loadingText
string
bgColor
TColor
appendInnerAvatar
string
appendInnerIcon
TIcon
prependInnerAvatar
string
prependInnerIcon
TIcon
clearIcon
TIcon
clearable
boolean
prependInnerAriaLabel
string
appendInnerAriaLabel
string
border
boolean | number | string | TDirectionBoth | Array<TDirectionBoth>
borderTop
boolean | number | string
borderLeft
boolean | number | string
borderBottom
boolean | number | string
borderRight
boolean | number | string
borderBlock
boolean | number | string
borderInline
boolean | number | string
borderInlineStart
boolean | number | string
borderInlineEnd
boolean | number | string
borderBlockStart
boolean | number | string
borderBlockEnd
boolean | number | string
borderColor
string
borderStyle
string
borderTopColor
TColor
borderRightColor
TColor
borderBottomColor
TColor
borderLeftColor
TColor
borderInlineStartColor
TColor
borderInlineEndColor
TColor
borderBlockStartColor
TColor
borderBlockEndColor
TColor
focused
boolean
text
string
floating
boolean
name
string
margin
boolean | number | string
marginTop
boolean | number | string
marginLeft
boolean | number | string
marginBottom
boolean | number | string
marginRight
boolean | number | string
marginBlock
boolean | number | string
marginInline
boolean | number | string
marginInlineStart
boolean | number | string
marginInlineEnd
boolean | number | string
marginBlockStart
boolean | number | string
marginBlockEnd
boolean | number | string
padding
boolean | number | string
paddingTop
boolean | number | string
paddingLeft
boolean | number | string
paddingBottom
boolean | number | string
paddingRight
boolean | number | string
paddingBlock
boolean | number | string
paddingInline
boolean | number | string
paddingInlineStart
boolean | number | string
paddingInlineEnd
boolean | number | string
paddingBlockStart
boolean | number | string
paddingBlockEnd
boolean | number | string
rounded
boolean | number | string | TRounded | null | undefined
roundedTopRight
boolean | number | string
roundedTopLeft
boolean | number | string
roundedBottomLeft
boolean | number | string
roundedBottomRight
boolean | number | string
roundedStartStart
boolean | number | string
roundedStartEnd
boolean | number | string
roundedEndStart
boolean | number | string
roundedEndEnd
boolean | number | string
fontSize
TFontSize
fontWeight
TFontWeight
lineHeight
TLineHeight
letterSpacing
TLetterSpacing
active
boolean | IStateEffectConfig
activeClass
string
variant
'outlined'
Visual variant (outlined, filled, underlined, solo, plain).
elevation
TElevation
size
TSize | number
hideDetails
boolean | string
hideSpinButtons
boolean
hint
string
persistentHint
boolean
messages
Array<string> | string
height
number | string
maxHeight
number | string
maxWidth
number | string
minHeight
number | string
minWidth
number | string
width
number | string
direction
TDirection
errorMessages
Array<string> | string
maxErrors
number | string
readonly
boolean
false
Makes the field read-only.
rules
Array<any>
[]
Form validation rules. Required-based rules (needTiny, needUppercase…) are auto-injected when requirements=true.
modelValue
any
Current password value. Use v-model to bind two-way.
validateOn
TValidateOn
validationValue
any
appendAvatar
string
appendIcon
TIcon
prependAvatar
string
prependIcon
TIcon
prependAriaLabel
string
appendAriaLabel
string

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:control
MouseEvent
Fired when the show/hide toggle icon is clicked.
@mousedown:control
MouseEvent
Fired on pointerdown on the toggle icon.
@update:strength
TPasswordStrengthLevel
Fires when the computed strength level changes (weak | fair | good | strong). Supports v-model:strength.
@update:focused
any
@click:appendInner
MouseEvent
@click:prependInner
MouseEvent
@click:clear
MouseEvent
Fired when the clear button is clicked (clearable=true).
@update:modelValue
any
Two-way binding for the password string value.
@click:append
MouseEvent
@click:prepend
MouseEvent

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

textbox

Interactions clavier

Interactions clavier
ToucheAction
TabMoves 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.

Source
number
0.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

vue

With requirements checklist

vue

Tiles layout

vue