Label
Native label wrapper for form fields and inline UI copy.
Installation
npx @glass-ui-kit/cli add labelUsage
Examples
Checkbox Pairing
Labels are especially useful for making checkbox rows easier to scan and click without losing native behavior.
Field Pairing
Inside Field, Label can inherit the control id automatically. Use htmlFor when you need to target a control outside the current field.
Styling
Label accepts standard label attributes and class composition. Use className as an escape hatch for one-off visual tweaks. When htmlFor is omitted inside Field, it binds to the registered field control automatically.
API Reference
| Prop | Type |
|---|---|
htmlFor | string |
className | string |
Label also accepts the standard native <label> props. Inside Field, htmlFor becomes optional because the control id can be inferred automatically.