Keyframery

Animated Password Input for UI SDK

The text comes into focus out of a blur when revealed, and requirements tick as they are met.

Part of Keyframery, the open-source animated components for UI SDK

The demo plays by itself. Point at it or press Tab to take over.

Installation

npx shadcn@latest add @keyframery/password-input

This adds components/keyframery/password-input.tsx and its primitive, components/keyframery/primitives/password-input.tsx, to your project, and installs @ui-sdk/react. The motion tokens are added to your global CSS the first time you install a component.

Usage

import {
  PasswordInput,
  PasswordInputCapsLock,
  PasswordInputControl,
  PasswordInputToggle,
} from "@/components/keyframery/password-input"

The parts and props are the same as UI SDK's Password Input. For every prop, see the UI SDK password input reference.

What moves

MoveWhat you see
FadeThe text comes into focus out of a blur when revealed.
PopThe eye icons swap with a pop.
DrawRequirement ticks draw themselves as each rule is met.

Timing and springiness follow the motion style you set, so this component moves like the rest of your app.

Swap the import

Already using UI SDK's password input with your own styles? Keep your markup and change one line. The primitive adds motion and nothing else.

// Before
import { … } from "@ui-sdk/react/password-input"

// After: same parts, same props, now animated
import { … } from "@/components/keyframery/primitives/password-input"

Parts

The finished component exports 4 parts:

PasswordInput, PasswordInputCapsLock, PasswordInputControl, PasswordInputToggle

Accessibility

Keyboard, focus and screen-reader behaviour come from UI SDK and are not changed. With reduced motion turned on, nothing in the password input moves: changes happen at once or with a short fade. More in Accessibility.

Source

The code that lands in your project. It is yours to change.

Questions

How does the animated Password Input for UI SDK move?

Fade: The text comes into focus out of a blur when revealed. Pop: The eye icons swap with a pop. Draw: Requirement ticks draw themselves as each rule is met.

Do I need Motion or Framer Motion for the animated Password Input?

No. Every move is plain CSS, so there is nothing to install besides the component and UI SDK.

Can I keep my own styling and only take the motion?

Yes. Import from @/components/keyframery/primitives/password-input instead. It has the same parts and props as @ui-sdk/react/password-input and adds motion only.

What happens to the Password Input when someone turns on reduced motion?

Nothing moves. State changes happen at once, or with a short fade.

On this page