- GitHub: [BonnierNews/dn-design-system/../web/src/components/checkbox](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/checkbox)
- Storybook: [Form > Checkbox](https://designsystem.dn.se/?path=/docs/basic-form-checkbox--docs)
- Storybook (Latest): [Form > Checkbox](https://designsystem-latest.dn.se/?path=/docs/basic-form-checkbox--docs)

----

# Checkbox

## Parameters

|parameter | type | required | options | default | description |
|:--- | :--- | :--- | :--- | :--- | :--- |
|name | String | yes | | | Also used as id |
|label | String | no | | | |
|checked | bool | no | true, false | false | |
|disabled | bool | no | true, false | false | |
|error | bool | no | true, false | false | |
|errorMessage | String | no | | | |
|required | bool | no | true, false | false | |
|validation | String | no | | | To use with the sites validation, some example values for dn-web: required, password, email |
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|classNames | String | no | | | Ex. "my-special-class" |
|forcePx | bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size |

## Minimum requirement example

### Nunjucks

These are copy paste friendly examples to quickliy get started using a component.

```html
{% from '@bonniernews/dn-design-system-web/components/checkbox/checkbox.njk' import Checkbox %}

{{ Checkbox({
  label: 'My checkbox',
  name: 'my-checkbox'
})}}
```

### SCSS
```scss
@use "@bonniernews/dn-design-system-web/components/checkbox/checkbox";
```
