Label
beta
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> Label Text</Label>
Prop | Required | Default | Type |
---|---|---|---|
variant | false | default | 'default' | 'primary' |
htmlFor | false | string | |
optional | false | false | boolean |
className | false | string | |
children | true | ReactNode |