--- import DefaultLayout from '@shared/layouts/DefaultLayout.astro' import CaptureScript from '@shared/components/CaptureScript.astro' import Card from '@ui/Card.astro' import CardBody from '@ui/CardBody.astro' import CardTitle from '@ui/CardTitle.astro' import CardSubtitle from '@ui/CardSubtitle.astro' import FormGroup from '@ui/FormGroup.astro' import InputGroup from '@ui/InputGroup.astro' import Strength from '@ui/Strength.astro' import Badge from '@ui/Badge.astro' import Button from '@ui/Button.astro' import DocsLink from '@ui/DocsLink.astro' ---
Basic Add data-bs-strength to a strength element next to the field. A strength-text shows the label.
Rules until the first letter Text written inside strength-text shows while the field is empty, so the password rules can stand there until a level takes over. Use 8 to 20 characters, with letters and numbers.
Without a label The strength-text is optional. Left out, the meter is the only feedback.
Number of segments Segments fill in proportion, so a meter can have three, four or more of them.
Own labels Pass data-bs-messages as JSON to rename the levels.
Stricter scoring Raise data-bs-min-length and data-bs-thresholds to demand more before a password counts as strong.
Pointing at a field With several password fields, name the one to rate with data-bs-input.
Reacting to the level Every change of level fires change.bs.strength with the level and the score.
Without a field Without a password field in its parent and without data-bs-input, the meter stays empty.