A password input component with visibility toggle, built with Lit.
npm install @litforge/password-inputA password input component with visibility toggle, built with Lit.
The PasswordInput component provides a secure password input with optional visibility toggle functionality.
``bash`
npm install @litforge/password-inputor
pnpm add @litforge/password-inputor
yarn add @litforge/password-input
`html
placeholder="Enter your password"
value="${password}"
@input="${handlePasswordChange}"
>
`
| Property | Type | Default | Description |
|----------|------|---------|-------------|
| label | string | undefined | Input label |placeholder
| | string | undefined | Placeholder text |value
| | string | '' | Input value |error
| | string | undefined | Error message to display |disabled
| | boolean | false | Disables the input |required
| | boolean | false | Marks input as required |showToggle
| | boolean | false | Shows password visibility toggle button |
Fired when the input value changes.
`html`
placeholder="Enter password"
>
`html`
show-toggle
value="${password}"
>
`html`
value="${password}"
error="${passwordError}"
required
>
The component uses CSS variables for theming:
`css`
password-input {
--lf-password-input-font-family: 'Inter', sans-serif;
--lf-password-input-border-color: #e2e8f0;
--lf-password-input-error-color: #b42318;
/ ... more variables /
}
`typescript``
import { PasswordInput } from '@litforge/password-input';
Part of the LitForge component library.