Label
Names any control, and moves focus into it when pressed.
A plain <label> only reaches native inputs. Label names any control by its htmlFor,
including ui-sdk ones like a switch or a radio group. Wrapping a control in a Label works
too, as the checkbox examples show.
Dependencies
What it's built from and what's built from it in Base, read from the imports in its source.
| Uses | Textprimitive |
|---|---|
| Used by | Fieldform itemSelectform item |
| Packages | @ui-sdk/core@0.1.0-beta.20@ui-sdk/react@0.1.0-beta.20tailwind-variants@4.1.0 |
Installation
Set the project up for Base once first, as Getting started shows. Then add it with the CLI, or by hand.
With the CLI
Manually
Install its packages:
Add the components it uses first, listed under Dependencies.
Then copy the source:
API reference
Generated from Base's types. Props marked ours are added here; the rest come from the ui-sdk part it wraps. Every part also accepts its element's native attributes.
Label
Names any control by its htmlFor, and moves focus into it when pressed.
- className
Type string | ((state: {}) => string)
- debug
Logs every state change with its reason to the console, in development builds.
Type boolean
- render
Type RenderProp<{}>
- style
Type CSSProperties | ((state: {}) => CSSProperties)