DOCS
v0.4

Components / Password Input

Password Input

Password input with visibility toggle (eye icon) and optional strength meter. Uses zxcvbn-style scoring based on length + character classes.

formsv0.7.0

Playground

Examples

With strength
<cg-password-input label="Password" placeholder="Enter password" show-strength helper="Use 8+ characters with mixed case and numbers" style="max-width:360px;"></cg-password-input>
Basic
<cg-password-input label="Current password" placeholder="••••••••" style="max-width:360px;"></cg-password-input>

Import

import { CgPasswordInput } from '@cognivo/components';
// Or tree-shake: import '@cognivo/components/cg-password-input';

Per-component imports ship only that component (~8 kB gzip).

API Reference

PropTypeDefaultDescription
valuestring""Current value
labelstring""Label text
placeholderstring""Placeholder
show-strengthbooleanfalseShow strength meter
min-lengthnumber0Minimum length
requiredbooleanfalseRequired field
errorbooleanfalseError state
successbooleanfalseSuccess state
disabledbooleanfalseDisabled state

Events

EventDetailDescription
cg-password-change{value: string, strength?: number}Value changed
cg-password-toggle{visible: boolean}Visibility toggled