Label
The Label component is a customizable label for form elements. It supports various styling options through colors and includes an optional indicator.
Usage
import { Label } from '@harnessio/ui/components'
// ...
return ( <> <Label htmlFor="username">Username</Label> <input id="username" type="text" /> </>)API Reference
The Label component provides a styled label for form elements with customizable options.
<Label htmlFor="inputId" // [OPTIONAL] ID of the form control this label is associated with optional // [OPTIONAL] Indicate if the associated form field is optional color="primary" // [OPTIONAL] Color variant of the label> Label Text</Label>| Prop | Required | Default | Type |
|---|---|---|---|
| htmlFor | false | string | |
| optional | false | boolean | |
| color | false | 'primary' | 'secondary' | 'disabled' | 'disabled-dark' | |
| className | false | string | |
| children | true | ReactNode |