@k8ordo/ui

PasswordInput

A password field with a show/hide toggle.

Import

ts
import { PasswordInput } from '@k8ordo/ui';

Usage

tsx
<PasswordInput
  disabled={false}
  invalid={false}
  required={false}
  placeholder="Enter your password"
/>

Controlled

tsx
const [value, setValue] = useState('hunter2');

<PasswordInput
  disabled={false}
  invalid={false}
  required={false}
  onChange={(event) => setValue(event.target.value)}
  value={value}
/>

Disabled

tsx
<PasswordInput
  defaultValue="read-only-password"
  disabled
  invalid={false}
  required={false}
/>

Props

children?
Type: ReactNode
Default: -
hideLabel?
Type: string
Default: -
invalid?
Type: boolean
Default: false
ref?
Type: Ref<HTMLInputElement>
Default: -
showLabel?
Type: string
Default: -
PropTypeDefault
children?ReactNode-
hideLabel?string-
invalid?booleanfalse
ref?Ref<HTMLInputElement>-
showLabel?string-

Inherited attributes (except the ones set internally): InputHTMLAttributes<HTMLInputElement>

The wording this component draws (labels, placeholders, and so on) comes from the message dictionary unless a prop sets it. To replace it, see: i18n

k8ordo

React libraries that use Baseline features without holding back.