A React checkbox component with a styled indicator and label, with colours set through props.
Status: Stub. The package is one component file (src/index.js) and one stylesheet, under five source files, with no tests and no app inside src/ that uses the component.
Native checkboxes are hard to restyle consistently. This package wraps a checkbox input in a custom indicator and label, so the colours can be set through props.
- Renders an
<input type="checkbox">with a styled indicator and a label. - Takes
checkedColor,unCheckedColor,iconColorandlabelColorprops for the colours. - Shows a check mark when
valueis truthy. - Applies a
styleprop to the indicator and passes any other props, such asonChange, to the input.
A React function component compiled with Babel. babel.config.json controls the build, and npm run build writes the output to dist/, copying the stylesheet alongside it. The component imports styles.css, so a consuming app's bundler must handle CSS imports.
npm install
npm run buildThe only script is build, which removes dist/ and recompiles src/ with Babel.
valueis used as the checked flag and also passed to the input'svalueattribute. A separatecheckedprop would be cleaner.- The input uses
classrather thanclassName, which React warns about. - There are no tests, and nothing in
src/demonstrates the component.