Setup
aksel.nav.no
Controlled state
const [state, setState] = useState(["checkbox1"]);return (<CheckboxGrouplegend="My CheckboxGroup"value={state}onChange={(v) => setState(v)}><Checkbox value="checkbox1">1</Checkbox><Checkbox value="checkbox2">2</Checkbox><Checkbox value="checkbox3">3</Checkbox></CheckboxGroup>);
Props
Checkbox
Type |
|
---|---|
Description | Adds error indication on checkbox |
Default | false |
Type |
|
---|---|
Description | Checkbox label |
Type |
|
---|---|
Description | Hides label and makes it viewable for screen-readers only. |
Type |
|
---|---|
Description | The value of the HTML element. |
Type |
|
---|---|
Description | Specify whether the Checkbox is in an indeterminate state |
Default | false |
Type |
|
---|---|
Description | Adds a description to extend labling of Checkbox |
Type |
|
---|---|
Description | Changes font-size, padding and gaps |
Type |
|
---|---|
Description | Disables element @note Avoid using if possible for accessibility purposes |
Type |
|
---|---|
Description | Override internal id |
Type |
|
---|
Type |
|
---|
* Props er autogenerert fra kode, så avvik kan forekomme. Ta kontakt hvis noe ikke stemmer!
CheckboxGroup
Type |
|
---|---|
Description | Collection of <Checkbox/> |
Type |
|
---|---|
Description | Controlled state for checkboxes. |
Type |
|
---|---|
Description | Default checked checkboxes on render |
Type |
|
---|---|
Description | Returns current checked checkboxes in group |
Default | () => {} |
Type |
|
---|---|
Description | Fieldset legend |
Type |
|
---|---|
Description | If enabled shows the legend and description for screenreaders only |
Type |
|
---|---|
Description | Error message for element |
Type |
|
---|---|
Description | Override internal errorId |
Type |
|
---|---|
Description | Changes font-size, padding and gaps |
Type |
|
---|---|
Description | Disables element @note Avoid using if possible for accessibility purposes |
Type |
|
---|---|
Description | Adds a description to extend labling of a field |
Type |
|
---|---|
Description | Override internal id |
Type |
|
---|
Type |
|
---|
* Props er autogenerert fra kode, så avvik kan forekomme. Ta kontakt hvis noe ikke stemmer!