Skip to content
On this page

Label

Just like a regular <label />

Usage

See using components for detailed instructions.

js
import { CLabel } from 'chusho';

Config

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

js
{
  components: {
    label: {
      class: ({ variant }) => {},
    },
  },
}

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

js
class: 'label'

API

NameTypeDefaultDescription
Props
variant string|array|objectundefined

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

template
<CLabel>Label</CLabel>

Linked to a field

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

Released under the MIT License.