You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@asphalt-react/checkbox

Package Overview
Dependencies
Maintainers
6
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asphalt-react/checkbox

Checkbox

2.6.0
latest
npmnpm
Version published
Weekly downloads
712
374.67%
Maintainers
6
Weekly downloads
 
Created
Source

Checkbox

npm npm version

Checkboxes allow users to select one or more items from a list of items. There are three states in a Checkbox: Checked, Unchecked and Indeterminate. A Checkbox is in indeterminate state when it is neither checked nor unchecked.

To enhance accessibility, Checkboxes come with a label which is placed beside the component. The labels are of type text and they come in 3 sizes:

  • small (s)
  • medium (m) — default
  • large (l)

The size of the Checkbox remains the same for all label sizes. You can choose to skip the standard label and bind the Checkbox with you own label as well.

Checkboxes support most input type="checkbox" attributes like checked, value,onChange & disabled as well as data-* attributes. To get a handle of the underlying DOM element, use React Refs.

Accessibility

  • Checkbox accepts clicks on the checkbox as well as its label to toggle its state.
  • Use tab to move keyboard focus to the checkbox.
  • When in focus, press space to toggle the state.
  • All checkbox accept the aria-* attributes for "checkbox" role.

Accessibility must-haves

  • Add aria-label or aria-labelledby for cases where Checkbox does not have a dedicated label. For e.g. a checkbox used to select a table row.

  • Use id and htmlFor props to associate your custom label with the Checkbox.

Usage

import { Checkbox } from "@asphalt-react/checkbox"

<Checkbox value="yes" label="Are you a a GoTo employee?" />

Props

label

Label for the Checkbox

typerequireddefault
stringfalse""

size

Controls the label size. Size of the Checkbox remains same. Accepts s, m, l for small, medium & large

typerequireddefault
enumfalse"m"

indeterminate

Set indeterminate state of Checkbox

typerequireddefault
boolfalsefalse

Keywords

asphalt

FAQs

Package last updated on 11 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts