Socket
Book a DemoInstallSign in
Socket

@asphalt-react/radio

Package Overview
Dependencies
Maintainers
6
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@asphalt-react/radio

Radio

npmnpm
Version
2.9.0
Version published
Weekly downloads
118
306.9%
Maintainers
6
Weekly downloads
 
Created
Source

Radio

npm npm version

Radio buttons allow users to select only a single option from a list of options. There are 2 states in a Radio button: Checked and Unchecked.

To enhance accessibility, Radio buttons 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 Radio button remains the same for all label sizes. You can choose to skip the standard label and bind the Radio button with you own label as well.

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

Accessibility

  • Use tab to move focus between Radio buttons.
  • Press space to make a selection.
  • Use arrow keys to change the selection among a list of Radio buttons.
  • Radio buttons accept the aria-* attributes for "radio" role.

Accessibility must-haves

  • Add aria-label or aria-labelledby for cases where Radio buttons do not have a dedicated label.

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

Usage

import { Radio } from "@asphalt-react/radio"

<Radio value="GoPay" label="Mode of payment" />

Props

label

Label for the radio button.

typerequireddefault
stringfalse""

size

Controls the label size. Size of the radio buton doesn't change. Accepts s, m, l for small, medium & large

typerequireddefault
enumfalse"m"

Keywords

asphalt

FAQs

Package last updated on 02 Oct 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