Form.Label
Provide a label for a form control.
Form.Label
uses a FormGroupContext
(provided by Form.Group
) to ensure that
it has an htmlFor attribute matching the Form.Control
according to WCAG guidelines.
Basic usage
Show editable code example
Any Paragon component or export may be added to the code example.
Inline usage
Show editable code example
Any Paragon component or export may be added to the code example.
Usage with grouped control
Show editable code example
Any Paragon component or export may be added to the code example.
Sizes
Show editable code example
Any Paragon component or export may be added to the code example.
See Form.Control for floating labels
Show editable code example
Any Paragon component or export may be added to the code example.
Theme Variables#
CSS Variable | Computed Value |
---|---|
| |
| |
| |
| |
| |
Props API#
FormLabel Props API
- className
string
Specifies class name to append to the base element.
- children
node
RequiredSpecifies contents of the component.
- isInline
bool
DefaultfalseSpecifies whether the component should be displayed with inline styling.
- size
enum
'sm' | 'lg'Specifies size of the component.
Usage Insights#
FormLabel
Project Name | Paragon Version | Instance Count | |
---|---|---|---|
frontend-app-course-authoring | 21.5.6 | 1 | |
frontend-app-learner-dashboard | 20.46.2 | 2 | |
prospectus | 20.46.2 | 7 |