Skip to main content

Checkbox

img

Usage

import React from 'react'
import { Checkbox } from 'qdm-component-library'

function App() {
const [CheckboxOpen, setCheckboxOpen] = useState('primary')

const HandleCheckboxOpen = (e, val) => {
const values = val === CheckboxOpen ? null : val
setCheckboxOpen(values)
}

return (
<Checkbox
color={'secondary'}
checked={CheckboxOpen === 'secondary' ? true : false}
name={"color='secondary'"}
onClick={(e) => HandleCheckboxOpen(e, 'secondary')}
/>
)
}
export default App

Reference

Props

className

props for providing classname to Checkbox component string

id

props for providing id to Checkbox component string

name

props for providing name to Checkbox component string

checked

props for value to Checkbox Component,if its true it is checked boolean

disabled

if its true you cant change Checkbox Component value boolean

onClick

props for changing value of the Checkbox Component function

defaultChecked

props for providing default value for Checkbox Component boolean

indeterminate

props for changing tick icon to minus icon Checkbox Component boolean

color

props for providing color to Checkbox Component "default" | "primary" | "secondary"

size

props for providing size to Checkbox Component "medium" | "small"

inLineStyles

props give addition props to the Checkbox Component type Object