Examples

Sign-in and new password

Preview

At least 12 characters.

Example.tsx
import { PasswordInput, Stack } from '@reactloom/ui';

export default function Example() {
  return (
    <Stack gap="5" style={{ width: '100%', maxWidth: 360 }}>
      <PasswordInput label="Current password" />
      <PasswordInput label="New password" autoComplete="new-password" description="At least 12 characters." />
    </Stack>
  );
}

API reference

PasswordInput props
PropTypeDefault
visible / defaultVisible
Controlled / uncontrolled visibility.
boolean—
onVisibleChange
(visible: boolean) => void—
toggleLabel
One stable label; the button uses aria-pressed.
string'Show password'
autoComplete
'current-password' | 'new-password''current-password'
…
Everything Input accepts.
InputProps—

Customization

Extracted from the component’s source on every build, so it matches the code. How the layers fit together is explained in Customization.

Renders Input, so its hooks apply too.

Slot class names

Add classes to inner parts with classNames (className is shorthand for root): root, label, description, control, input, section, error.

CSS variables

VariableDefault
--pl-input-radiusvar(--pl-radius-md

State attributes

Target these in your CSS to style states without depending on class names.

AttributeValues
[data-disabled]present when on
[data-invalid]present when on
[data-radius]none · sm · md · lg · full
[data-readonly]present when on
[data-size]sm · md · lg

Theme tokens it reads

--pl-color-bg-subtle --pl-color-bg-surface --pl-color-border-default --pl-color-border-focus --pl-color-border-input --pl-color-danger-border --pl-color-fg-default --pl-color-fg-disabled --pl-color-fg-muted --pl-color-fg-subtle --pl-control-height-lg --pl-control-height-md --pl-control-height-sm --pl-focus-ring-color --pl-focus-ring-width --pl-font-size-lg --pl-font-size-md --pl-font-size-sm --pl-radius-full --pl-radius-lg --pl-radius-md --pl-radius-none --pl-radius-sm --pl-shadow-xs

Accessibility

  • The toggle is a real button with aria-pressed, so its name never changes.
Keyboard interactions
KeyAction
TabMove between field and toggle

Usage guidelines

Do

  • Use autoComplete="new-password" on sign-up and change-password forms.

Don’t

  • Don’t block paste — password managers need it.