# Password Input — React Native component for Expo

> An eye toggle that twists between states, and a strength meter that springs full.

Floating-label password field with an eye / eye-off toggle that cross-fades and spins, a spring-filled strength meter that shifts colour with the score, a live requirements checklist that ticks itself off, and a confirm mode that says when passwords match.

- Docs: https://expokit.in/docs/components/password-input
- Tier: Free
- Also called: password field, show / hide password input, password strength meter
- Category: Inputs
- Platforms: iOS, Android, web
- Expo Go: yes, no development build needed
- npm dependencies: react-native-svg
- Uses ExpoKit items: kit, floating-input
- Variants: Create Password, Sign In, Strength Meter, Custom Rules, Wrong Password

## Installation

Run once per project: `npx @expokit/cli@latest init` (shared theme + KitProvider). Then:

```bash
npx @expokit/cli@latest add password-input
```

The CLI copies the source into your project (you own the code) and installs react-native-svg.

Import: `import { PasswordInput } from "@/components/ui/password-input";`

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `strength` | `boolean` | `true` | Show the animated strength meter. |
| `score` | `(pw) => 0–4` | `built-in` | Custom strength scorer. |
| `requirements` | `{ label, test }[] \| boolean` | — | Checklist under the field; true uses DEFAULT_PASSWORD_REQUIREMENTS (8+ chars, upper & lower, number, symbol). |
| `confirmOf` | `string` | — | Confirm-password mode: shows match / mismatch once the user types. |
| `matchMessage / mismatchMessage` | `string` | `labels.passwordsMatch / labels.passwordsDontMatch` | Copy for confirm mode. |
| `floatingLabel` | `boolean` | `true` | Passed to FloatingInput: set to false to put the label above the field (no notch) and show placeholder inside. |
| `iconColor` | `string` | `theme mutedForeground` | Eye / eye-off toggle and clear button colour. |
| `fieldStyle / inputStyle / labelStyle / messageStyle / counterStyle` | `StyleProp` | — | Style slots passed straight to FloatingInput — see Floating Input. |
| `…FloatingInputProps` | `` | — | Every Floating Input prop (error, success, size, variant, …). |
| `className` | `string` | — | Tailwind classes on the root when using NativeWind or Uniwind. Prefer style for StyleSheet overrides. |

## Behaviour & accessibility

- **Touch**: The eye button has a 44pt hit area and toggles secureTextEntry. With confirmOf, a match or mismatch message appears as soon as the typing diverges.
- **Motion**: Eye and eye-off cross-fade with a spring twist. The four meter segments fill left to right in a stagger, and checklist ticks pop in as rules are met.
- **Keyboard**: Auto-capitalisation and autocorrect are turned off for the field.
- **Screen readers**: The toggle is a button labelled 'Show password' or 'Hide password'. The meter reads 'Password strength: Strong' and each requirement reads as done or not yet.

## FAQ

### How do I make a password field in React Native?

Use ExpoKit's Password Input: run npx @expokit/cli@latest add password-input in your Expo or React Native project and it copies a ready-made password field into your app as plain TypeScript you can edit. It works on iOS, Android and web, and in Expo Go.

### Does Password Input work in Expo Go?

Yes. Password Input runs in Expo Go on iOS and Android with no development build — its packages (react-native-svg) are all included in Expo Go.

### How do I add Password Input to my Expo app?

Run npx @expokit/cli@latest add password-input in your project. The CLI copies the component's source into your app and installs react-native-svg, so the code is yours to change.

### Is Password Input free?

Yes. Password Input is free: its full source is on this page and the CLI installs it without an account.

### Can I change how Password Input looks?

Yes. It takes its colours, radius and light / dark mode from useKit(), so wrapping your app in <KitProvider accent radius> re-skins it with every other ExpoKit component. The code lives in your project, so you can also edit anything directly.

## More

- Live preview, variants and code: https://expokit.in/docs/components/password-input
- Every ExpoKit component, screen, template and chart: https://expokit.in/llms.txt
- Install commands and props for every free component: https://expokit.in/llms-full.txt
- Pricing: https://expokit.in/pricing
