Control labels are used to identify form components such as FormControl
, Checkbox
, Password
and TextArea
. Best practice is to use this component as a child of FormGroup
.
Three sizes are supported: 'lg'
(the default), 'md'
and 'sm'
. Use the size
property to set the size.
Use the required
property to show visual indication with the label.
Property | Type | Default | Description |
---|---|---|---|
className | String | Any custom classes to add to the <label> element. | |
htmlFor | String | Sets the for attribute on the <label> element. If used within a FormGroup, the controlId property will be used. The htmlFor property overrides controlId . | |
required | Boolean | false | Appends the required field indicator (red asterisk) to the end of the label text. |
size | String | 'lg' | Size of the <label> element. Options are 'lg' , 'md' , 'sm' . |