Label Component
A form label component that is accessible, customizable, and properly associates with form controls.
- Automatically links to form controls with matching id
- Properly handles disabled states
- Supports required field indicator
- Follows accessibility best practices
Installation
The Label component is part of our UI library. You can import it directly from the components directory.
Usage
Here is how to use the label in your project.
React TSX
React TSX
Examples
Basic Label
API Reference
Label
Prop | Type | Default | Description |
---|---|---|---|
htmlFor | string | - | The id of the form control to associate with |
className | string | - | Additional CSS classes |
disabled | boolean | false | Whether the label is disabled |
children | ReactNode | - | The content of the label |
Additionally, all standard HTML label attributes are supported.