Label
The words in front of a field.
Default
Click the words rather than the box — the box ticks.
Tie it to its field and two things follow: clicking the words focuses or ticks the field, and a screen reader reads the label when the field takes focus. A field without one is a field nobody can name.
Installation
npx philcn@latest add labelThe file is written into your project. It is yours from then on — change it as you like.
Props
| Prop | Type | What it does |
|---|---|---|
| Label.htmlFor | string | The id of the field it names. This is the tie; without it the label is decoration. |
Types are read from the library itself, so this table cannot describe an option the code no longer has. Everything else you pass goes straight to the underlying <label>.