Password Meter
React Native (Expo)
A React Native strength meter whose four bars fill and change colour as a password gets stronger.
Four bars that fill and change colour as a password gets stronger, with the verdict beside them. The rating looks at length and how many kinds of character are mixed. It is a hint, not a guarantee, and the verdict is read out whenever it changes. Built for React Native and Expo with react-native only; this page previews it in the browser through react-native-web.
Installation
CLI
npx @modus-ui/cli add password-meterManual
- Copy the code from the component tab.
- Create a file at
components/ui/password-meter.tsx. - Paste the code.
It needs no packages beyond react-native, which your Expo or React Native app already has.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | - | The password to rate. |
showLabel | boolean | true | Shows the strength as a word beside the bars. |
colors | Partial<PasswordMeterColors> | - | Overrides track, weak, fair, good, strong and text. |
style | StyleProp<ViewStyle> | - | Style for the meter's row. |
Comments