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
Name | Type | Default | Description |
---|---|---|---|
Props | |||
variant | string|array|object | undefined | Useful when used in the component config |
bare | boolean | false | 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>