Skip to content

Latest commit

 

History

History

fyndiq-component-checkbox

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

fyndiq-component-checkbox npm

Preview

A checkbox component for Fyndiq

Installation

The component can be installed through NPM:

npm i -S fyndiq-component-checkbox

Usage

import React from 'react'
import Checkbox from 'fyndiq-component-checkbox'

// Basic usage
<Checkbox onToggle={newStatus => console.log(newStatus)} />

// Control the checked state
<Checkbox checked />

// Change the color of the checkmark
<Checkbox color="red" />

// Disabled checkbox
<Checkbox disabled />

API

The component Checkbox has the following customizable props:

Name Type Description Default value
onToggle Function The handler called whenever the checkbox changes state. The argument passed is the new state of the checkbox. noop => noop
className String Optional class for advanced styling  ''
color String The color of the checkmark light grey
checked Boolean Activates the checkbox.  false
disabled Boolean Disables the checkbox. false
 indeterminate  Boolean Activates the indeterminate mode. Usefull when the checkbox has children checkboxes. See CSS-tricks  false