# @opuscapita/react-checkbox

> OpusCapita react component template

Latest version **2.0.2** (published 2019-05-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @opuscapita/react-checkbox
pnpm add @opuscapita/react-checkbox
yarn add @opuscapita/react-checkbox
bun add @opuscapita/react-checkbox
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2019-05-27 |
| First published | 2018-03-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.10.0 |
| Dependencies | 3 |
| Unpacked size | 319.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | OpusCapita |
| Maintainers | abaliunov-sc, adam-dziomdziora-cybercom, alexanderdanilov, alexeysergeev, amourzenkov-sc, bo-kh, dmitrydivin, dsanko, dzhitomirsky, egor.stambakio, elefantino, eriihine, gr4per, havantkim, ilkkalehtinen, janek.bug, jenni, jluukka, kirillvolkovich, kwierchris, lukaszkepa, naniantero, nczeranka, nkovalenko-sc, ocmachineuser, pdetmer, samikarj, tamkov-sc, zjuice |

## Links

- npm: https://www.npmjs.com/package/@opuscapita/react-checkbox
- Repository: https://github.com/OpusCapita/react-checkbox
- Homepage: https://github.com/OpusCapita/react-checkbox#readme
- Issues: https://github.com/OpusCapita/react-checkbox/issues
- npm.io page: https://npm.io/package/@opuscapita/react-checkbox

## Dependencies (3)

- [classnames](https://npm.io/package/classnames.md) 2.2.6
- [react-icons](https://npm.io/package/react-icons.md) 2.2.7
- [@opuscapita/oc-cm-common-styles](https://npm.io/package/@opuscapita/oc-cm-common-styles.md) 3.0.0

## Recent versions

- 2.0.2 (latest) — 2019-05-27
- 2.0.1 — 2019-05-10
- 2.0.0 — 2019-05-10
- 1.4.2 — 2018-12-19
- 1.4.1 — 2018-11-30
- 1.4.0 — 2018-11-30
- 1.3.1 — 2018-11-20
- 1.3.0 — 2018-11-20
- 1.2.1 — 2018-11-13
- 1.2.0 — 2018-10-18
- 1.1.4 — 2018-09-26
- 1.1.3 — 2018-06-08
- 1.1.2 — 2018-05-25
- 1.1.1 — 2018-03-28
- 1.1.0 — 2018-03-23
- … 1 more at https://npm.io/package/@opuscapita/react-checkbox/versions

## README

# react-checkbox

### Description
OpusCapita styled checkbox component

### Installation
```
npm install @opuscapita/react-checkbox
```

### Demo
View the [DEMO](https://opuscapita.github.io/react-checkbox)

### Builds
#### UMD
The default build with compiled styles in the .js file. Also minified version available in the lib/umd directory.
#### CommonJS/ES Module
You need to configure your module loader to use `cjs` or `es` fields of the package.json to use these module types.
Also you need to configure sass loader, since all the styles are in sass format.
* With webpack use [resolve.mainFields](https://webpack.js.org/configuration/resolve/#resolve-mainfields) to configure the module type.
* Add [SASS loader](https://github.com/webpack-contrib/sass-loader) to support importing of SASS styles.

### API
| Prop name                | Type             | Default                                  | Description                              |
| ------------------------ | ---------------- | ---------------------------------------- | ---------------------------------------- |
| onChange                 | function         | required                                 | Callback function for checkbox           |
| onFocus                  | function         | () => {}                                 | onFocus callback function for checkbox   |
| onBlur                   | function         | () => {}                                 | onBlur callback function for checkbox    |
| checked                  | boolean          | false                                    | Is checked or not                        |
| className                | string           |                                          | Additional class for component           |
| disabled                 | boolean          | false                                    | Is disabled                              |
| id                       | string           |                                          | ID attribute. Resulting element ID will be `${id}-checkbox`                                       |
| name                     | string           |                                          | Name attribute                           |
| value                    | string           |                                          | Value attribute                          |
| label                    | string or node   |                                          | Checkbox label                           |
| tabIndex                 | string           | 0                                        | tabIndex                                 |

### Code example
```jsx
import React from 'react';
import Checkbox from '@opuscapita/react-checkbox';

export default class ReactView extends React.Component {
  render() {
    return (
      <Checkbox
        onChange={this.onChange}
      />
    );
  }
}
```

---
_Source: https://npm.io/package/@opuscapita/react-checkbox · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
