Scoring is a pure heuristic, no external lib. A score from 0-4 adds a point each for length ≥ 8, mixed case, a digit, and a symbol. No network call, no dictionary check, it's meant to give directional feedback, not a real entropy estimate.
One color drives every filled segment. The score maps to a single label + color pair (Weak red, Fair orange, Good yellow, Strong green), and every segment below that score gets the same color, so the bar reads as "progressively more green" rather than each chunk having its own fixed color.
Each segment animates independently with withTiming, never a spring. This component repaints on every keystroke, and a spring bouncing on every character would feel sloppy almost immediately.
The neutral base respects color scheme, the strength colors don't. Empty segments read useColorScheme() for their gray, but the four strength colors are fixed hex values so red always reads as red on either background.
SEGMENT_COUNT: change the number of chunks; the score itself is capped at 4, so raising this past 4 leaves extra segments unreachable unless the scoring cap changes too
WEAK_COLOR / FAIR_COLOR / GOOD_COLOR / STRONG_COLOR: swap for your own palette
the 220ms duration and easing in Segment, how quickly a segment fills in as the score crosses its index
the four heuristic checks in getScore, add or remove rules (e.g. a common-password blocklist) without touching the rendering at all
See exactly how this works with an RSLAB subscription.