ControlLabel

import { ControlLabel } from '@concur/nui-widgets';

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.

Examples

Sizes

Three sizes are supported: 'lg' (the default), 'md' and 'sm'. Use the size property to set the size.

<ControlLabel>Large Label</ControlLabel>

<ControlLabel size='md'>Medium Label</ControlLabel>

<ControlLabel size='sm'>Small Label</ControlLabel>

Required

Use the required property to show visual indication with the label.

<ControlLabel required>Label</ControlLabel>

Usage

Properties

Property Type Default Description
bsClass String 'control-label' Base CSS class and prefix for the component. One should not generally change bsClass except to add new, non-Bootstrap CSS styles to a component.
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. This property overrides that.
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'.
validationMessageState String   If used in conjunction with field validation, this provides the icon next to the label. Options are 'error', 'warning'.