Single-line password input with masked value, visibility toggle, CapsLock awareness, and an
optional composable strength meter. Anatomy follows Ark UI; CapsLockIndicator fills a
universal gap (10/10 surveyed libraries warn nothing when Caps Lock is on while typing).
Soma owns value, masking, autocomplete (current-password/new-password)
and Caps Lock detection.
PasswordField composes through 5 parts. Root drives value + visibility + caps detection;
every visual part is optional (composition over visibility props).
Type a character to fire commit-input. Press Enter to commit
commit-submit. Click the eye to fire
shift-toggle-visibility. Press Caps Lock while the input is focused to fire
shift-caps-state. Use ▶ play to dispatch the event without the gesture.
Recipe lives in src/uix/eidos/components/password-field/password-field.css.
Provider is the inline-flex container; tokens are private (--_password-field-*).
CapsLock indicator and StrengthMeter have their own data-* attribute states.
Selector
Owner
Purpose
[data-password-field]
morfo
Provider marker. Inline-flex container with border + focus ring.
<button type="button" aria-pressed={'{visible}'} aria-label="Show/Hide
password">. tabindex="-1" so it doesn't break the form's
natural tab order — the user toggles via mouse / programmatic focus instead.
Caps Lock detection
Soma listens to keydown/keyup on the input and reads
KeyboardEvent.getModifierState('CapsLock'). Indicator carries
role="status" + aria-live="polite" so screen readers
announce when Caps Lock turns on while typing.
Strength meter
role="meter" with aria-valuemin=0,
aria-valuemax=4, aria-valuenow. Visual segments are
aria-hidden; only the label is announced.
Keyboard
Enter fires commit-submit. No other keys hijacked —
selection / cursor movement / paste all behave natively.
Disabled / readonly
Mirrored to native attributes AND ARIA. The visibility trigger also disables when
the input is disabled.
Reduced motion
All transitions disabled under prefers-reduced-motion: reduce.