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
isSelectedboolean—Controlled checked state
defaultSelectedboolean—Uncontrolled default state
onChange(selected: boolean) => void—Called on change
isDisabledboolean—Disable the checkbox
childrenReactNode—Label content

On this page