Label

Just like a regular <label />

Config

The options below are to be set in the global configuration at the following location:

{
  components: {
    label: { ... },
  },
}

class

Classes applied to the label element, except when the prop bare is set to true. See styling components.

  • type: Array<String | Object> | Object | String | (props: Object) => {}
  • default: null

Example

class: 'label'

API

NameTypeDefaultDescription
Props
variant string|arraynull

Useful when used in the component config class option, to style it conditionally. See styling components.

bare booleanfalse

Disable class inheritance from the component config. See styling components.

Examples

Simplest

<CLabel>Label</CLabel>

Linked to a field

<CLabel for="the-field">
  <CCheckbox id="the-field" /> Something labelling the checkbox
</CLabel>