Checkbox
Import
import Checkbox from '@govuk-react/checkbox';
Usage
Simple
import { Checkbox } from 'govuk-react'
<Checkbox>Text displayed next to checkbox</Checkbox>
With disabled state
<Checkbox disabled="disabled">Disabled checkbox option</Checkbox>
Checkbox preselected
<Checkbox defaultChecked>Farm or agricultural waste</Checkbox>
Checkbox preselected & disabled
<Checkbox disabled="disabled" defaultChecked>Farm or agricultural waste</Checkbox>
Checkbox with hint text
<Checkbox hint="including English, Scottish, Welsh and Northern Irish">British</Checkbox>
References:
Properties
Prop | Required | Default | Type | Description |
---|
children | true | `````` | node | Text content for checkbox |
className | | undefined | string | CSS Classname for outermost container |
hint | | undefined | node | |