Anchor Design System

Radio

Radio allow users to select a single option from a list of mutually exclusive options.

Installation

Usage

Disabled

Checked

Accessibility

  • Radio groups are exposed to assistive technology via ARIA.
  • Each radio is built with a native HTML <input> element, which can be optionally visually hidden to allow custom styling.
  • Full support for browser features like form autofill.
  • Keyboard event support for arrows keys.
  • Keyboard focus management and cross browser normalization.
  • Group and radio labeling support for assistive technology.

API

Properties

PropertyAttributeDescriptionTypeDefault
backgroundbackgroundSet a white background for the radio button. Use this when the radio button is placed on a non-white backgroundbooleanfalse
checkedcheckedThe radio button is checkedbooleanfalse
disableddisabledDisable the radio buttonbooleanfalse
inputIdinput-idThis is name that the label refers tostringundefined
namenameThis is the name for the entire radio button groupstringundefined
valuevalueThis is the string that is returned as a value, when the form is submittedstring''

Events

EventDescriptionType
toggledCustomEvent<any>

Methods

toggleRadio(e?: any) => Promise<void>

Parameters

NameTypeDescription
eany

Returns

Type: Promise<void>

Dependencies

Depends on

Graph

graph TD;
  anchor-radio --> anchor-label
  style anchor-radio fill:#f9f,stroke:#333,stroke-width:4px

On this page