@asphalt-react/checkbox

1.17.0 • Public • Published

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

type required default
enum false "m"

label

Label for the Checkbox

type required default
string false ""

indeterminate

Set indeterminate status of checkbox

type required default
bool false false

Package Sidebar

Install

npm i @asphalt-react/checkbox

Weekly Downloads

96

Version

1.17.0

License

UNLICENSED

Unpacked Size

60.2 kB

Total Files

7

Last publish

Collaborators

  • shripriya.bhat
  • dawn29
  • itsjay26
  • sayantan1211
  • abhinav.preetu