1.17.0 • Published 7 months ago

@asphalt-react/checkbox v1.17.0

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
7 months ago

Checkbox

A component to select one or more items from a set of items. It can be in 3 states Checked, Unchecked and Indeterminate.

A checkbox is in indeterminate state when it is neither checked nor unchecked.

Most DOM attributes are supported and also supports 3 sizes - small, medium, large.

To get a handle of the underlying DOM element, use React Refs.

Accessibility

Checkbox is fully accessible by default. You don't necessarily need to add additional ARIA attributes.

  • Use tab or shift + tab to navigate between checkboxes
  • When focused, press space to check or uncheck

Usage

import Checkbox from "@asphalt-react/checkbox"
;<Checkbox value="yes" label="Are you a human ?" />

Props

size

Size of the Checkbox. accepts s, m, l for small, medium & large

typerequireddefault
enumfalse"m"

label

Label for the Checkbox

typerequireddefault
stringfalse""

indeterminate

Set indeterminate status of checkbox

typerequireddefault
boolfalsefalse