Kinetik UI

Password Meter

.md

A new-password field whose strength meter fills segment by segment while each rule below ticks off.

v1.0.0Live on webreact-native-reanimatedreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add password-meter

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/password-meter.json

Install manually

  1. Install dependencies
    npx expo install react-native-reanimated react-native-worklets
  2. Copy the source files
    • components/kinetik/password-meter.tsx
    View source files

Usage

import { PasswordMeter, passwordStrength } from '@/components/kinetik/password-meter';

<PasswordMeter value={password} onChangeText={setPassword} placeholder="At least 8 characters" />;

const canContinue = passwordStrength(password) >= 3;

passwordStrength gives the same 0 to 4 score the meter shows, so a form can require Good or better before it continues.

When to use

  • Creating or changing a password: sign up, reset, account settings.
  • Anywhere a password policy should be visible while typing rather than after a failed submit.

When not to use

  • Signing in. Strength does not matter there; use a plain password field.
  • As your only check. Validate on the server too, and consider a breached-password list.

Notes

  • rules replaces the default four rules (length, mixed case, a number, a symbol). The score is the share of rules met, scaled to the four segments.
  • The meter takes one colour for the overall strength, red through amber and blue to green.
  • The field sets textContentType="newPassword" and autoComplete="new-password", so password managers offer to generate one. Pass more input props through inputProps.
  • A change of strength is announced, but not every keystroke.
  • With reduced motion the meter and ticks change at once.

Props

PasswordMeterProps

PropTypeDefaultDescription
valuerequiredstring—
onChangeTextrequired(value: string) => void—
labelstring'Password'Shown above the field and names it. Defaults to 'Password'.
placeholderstring—
rulesreadonly PasswordRule[]defaultPasswordRulesWhat a strong password needs. Defaults to length, mixed case, a number and a symbol.
showRulesbooleantrueList the rules under the meter, each ticking off as it is met. Defaults to true.
inputPropsOmit<TextInputProps, 'value' | 'onChangeText' | 'secureTextEntry' | 'style'>—Passed to the text input, e.g. `onSubmitEditing` or `returnKeyType`.
testIDstring—
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
One shared value for the meter and one per rule, changed on keystrokes only. Nothing runs at rest.
Measured

Pixel 9 emulator, API 35, release build · interaction median 0.85× the system Settings app on the same emulator (indicative only) · no frames drawn at rest · 144 MB app memory

Real-device measurement pending.

Accessibility

Reduced motion
The meter and the rule ticks change at once, without filling or popping.
Screen readers
A secure text field named by its label, a Show password / Hide password button, and each rule read as met or not met. Changes in strength are announced.
Touch target
The field is 52 pt tall; the reveal button is at least 44 pt.

Source files

components/kinetik/password-meter.tsx is in the Code tab of the preview above.