pro-ui

Checkbox

Accessible checkbox input. Built on React Aria.

Import

import { Checkbox } from '@dangbt/pro-ui'

Usage

<Checkbox>Remember me</Checkbox>
 
<Checkbox defaultSelected>
  I agree to the Terms of Service
</Checkbox>

Controlled

const [checked, setChecked] = useState(false)
 
<Checkbox isSelected={checked} onChange={setChecked}>
  Enable notifications
</Checkbox>

Props

PropTypeDefaultDescription
isSelectedbooleanControlled checked state
defaultSelectedbooleanUncontrolled default state
onChange(selected: boolean) => voidCalled on change
isDisabledbooleanDisable the checkbox
childrenReactNodeLabel content

On this page