# react-checkbox-css

> A checkbox based on react thats easy to customize

Latest version **1.0.3** (published 2024-01-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-checkbox-css
pnpm add react-checkbox-css
yarn add react-checkbox-css
bun add react-checkbox-css
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2024-01-30 |
| First published | 2022-01-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 8.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Mehfooz-ur-Rehman |
| Maintainers | mehfooz-ur-rehman |
| Keywords | react, components, ui, checkbox, react-checkbox |

## Links

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

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^18.2.0
- [@babel/polyfill](https://npm.io/package/@babel/polyfill.md) ^7.12.1

## Alternatives

- [@progress/kendo-ooxml](https://npm.io/package/@progress/kendo-ooxml.md) — 152.1K weekly downloads
- [@progress/kendo-react-ripple](https://npm.io/package/@progress/kendo-react-ripple.md) — 8.0K weekly downloads
- [@progress/kendo-react-orgchart](https://npm.io/package/@progress/kendo-react-orgchart.md) — 4.3K weekly downloads
- [@praxisui/dynamic-fields](https://npm.io/package/@praxisui/dynamic-fields.md) — 2.4K weekly downloads
- [@progress/kendo-vue-listbox](https://npm.io/package/@progress/kendo-vue-listbox.md) — 932 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2024-01-30
- 1.0.2 — 2023-11-18
- 1.0.1 — 2023-04-01
- 1.0.0 — 2022-12-11
- 0.1.6 — 2022-11-26
- 0.1.5 — 2022-10-01
- 0.1.4 — 2022-09-01
- 0.1.3 — 2022-09-01
- 0.1.2 — 2022-09-01
- 0.1.1 — 2022-01-24
- 0.1.0 — 2022-01-24

## README

# react-checkbox-css

A checkbox based on react thats easy to customize

## Example

![Screenshot](./public/example.gif)

## Usage

```js
import React from "react";
import CheckBox from "react-checkbox-css";

function App() {
  const [isChecked, setIschecked] = React.useState(false);
  return (
    <CheckBox
      value={isChecked}
      label="label"
      labelColor="#242424"
      checkedColor="#242424"
      unCheckedColor="#7fffd4"
      iconColor="#ffffff"
      onChange={() => {
        isChecked ? setIschecked(false) : setIschecked(true);
      }}
    />
  );
}
```

```js
import React from "react";
import CheckBox from "react-checkbox-css";

function App() {
  const [isChecked, setIschecked] = React.useState(false);
  return (
    <CheckBox
      value={isChecked}
      label="label"
      labelColor="#242424"
      checkedColor="#242424"
      unCheckedColor="#7fffd4"
      iconColor="#ffffff"
      style={{ borderRadius: 20 }}
      onChange={() => {
        isChecked ? setIschecked(false) : setIschecked(true);
      }}
    />
  );
}
```

```js
import React from "react";
import CheckBox from "react-checkbox-css";

function App() {
  const [isChecked, setIschecked] = React.useState(false);
  return (
    <CheckBox
      value={isChecked}
      label="label"
      labelColor="#242424"
      checkedColor="linear-gradient(45deg, #797979, #242424)"
      unCheckedColor="brown"
      iconColor="#ffffff"
      style={{ borderRadius: 20 }}
      onChange={() => {
        isChecked ? setIschecked(false) : setIschecked(true);
      }}
    />
  );
}
```

## Props

Common props you may want to specify include:

- `value` - value of checkbox
- `label` - set label of checkbox
- `labelColor` - set color of label of checkbox
- `checkedColor` - set background color of checkbox when checked
- `unCheckedColor` - set background color of checkbox when unchecked
- `iconColor` - set color of check icon
- `onChange` - onchange function of checkbox
- `style` - can do custom styling

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in your browser.

This has a starter project using this package you can test it there

### `npm run build`

Builds the package for production to the `dist` folder.\

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