Helper text under form fields for hints, validation messages, and descriptions. Pair with aria-describedby on the control.
Setup
<script lang="ts">
import { Helper, Input, Label } from '.';
</script> Default
We’ll never share your email.
<script lang="ts">
import { Helper, Input, Label } from '.';
</script>
<Label for="email" class="mb-2">Your email</Label>
<Input id="email" type="email" placeholder="name@company.com" aria-describedby="email-help" />
<Helper id="email-help">We’ll never share your email.</Helper> Colors
Theme colors: primary, secondary, gray (default), red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose.
Your password is strong.
Username already taken.
Tip: use a unique passphrase.
<Helper color="green">Your password is strong.</Helper>
<Helper color="red">Username already taken.</Helper>
<Helper color="blue">Tip: use a unique passphrase.</Helper> Accessibility
- Set a stable
idonHelperand point the control’saria-describedbyat it. - Use
color="red"(or similar) for errors and keep the message text explicit. - Prefer short, actionable copy.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | Snippet | — | Helper message content |
color | theme color | gray | Text color token |
id | string | — | For aria-describedby |
class | ClassValue | — | Extra classes |
...rest | HTML <p> attrs | — | Other paragraph attributes |