1.0.3 • Published 3 months ago

react-checkbox-css v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

react-checkbox-css

A checkbox based on react thats easy to customize

Example

Screenshot

Usage

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);
      }}
    />
  );
}
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);
      }}
    />
  );
}
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 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.\

1.0.3

3 months ago

1.0.2

6 months ago

1.0.1

1 year ago

1.0.0

1 year ago

0.1.6

1 year ago

0.1.2

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.5

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago