Radio Button Group allows you to switch between horizontal and vertical layouts of Radio Buttons.

Overview

Built of Radio Buttons, you can control the group's scale, layout, and state in a single wrapper.

Sample

Usage

  • Groups of Radio Buttons
  • Easy switching between vertical and horizontal layouts for responsive design

Best practices

Radio Button Group with a small subset of six Radio Buttons comprised of tree types with the Maple value checked.
Do use Radio Button Groups for a small number of options.
Radio Button Group with a large subset of 27 Radio Buttons comprised of tree types with the Banyan value checked.
Avoid using Radio Button Groups for a large number of options. Consider Combobox with a selection-mode of "single" or "single-persist" instead.

Accessibility

Keyboard navigation

KeyFunction
Arrow leftMoves focus and selection to previous calcite-radio-button. If the current focus and selection is the first calcite-radio-button, the focus and selection will cycle to the last calcite-radio-button.
Arrow rightMoves focus and selection to next calcite-radio-button. If the current focus and selection is the last calcite-radio-button, the focus and selection will cycle to the first calcite-radio-button.
Arrow downMoves focus and selection to previous calcite-radio-button. If the current focus and selection is the first calcite-radio-button, the focus and selection will cycle to the last calcite-radio-button.
Arrow upMoves focus and selection to next calcite-radio-button. If the current focus and selection is the last calcite-radio-button, the focus and selection will cycle to the first calcite-radio-button.
TabMoves focus in and out of component.
Tab and ShiftMoves focus in and out of component.

Writing and copy

  • Keep Radio Button tone and length consistent within groups
  • Avoid forming questions with Radio Button text

API reference

Properties

PropertyAttributeDescriptionTypeDefault
disableddisabledWhen true, interaction is prevented and the component is displayed with lower opacity.booleanfalse
labelTextlabel-textSpecifies the component's label text.string
layoutlayoutSpecifies the layout of the component.Extract<"horizontal" | "vertical", Layout>"horizontal"
messageOverridesOverrides individual strings used by the component.Record<string, unknown> | undefined
namerequirednameSpecifies the name of the component. Required to pass the component's value on form submission.string
requiredrequiredWhen true and the component resides in a form, the component must have a value in order for the form to submit.booleanfalse
scalescaleSpecifies the size of the component.Scale"m"
selectedItemread-onlySpecifies the component's selected item.RadioButton
statusstatusSpecifies the status of the validation message.Status"idle"
validationIconvalidation-iconSpecifies the validation icon to display under the component.IconName | boolean
validationMessagevalidation-messageSpecifies the validation message to display under the component.string

Slots

NameDescription
default (unnamed)A slot for adding calcite-radio-buttons.
label-contentA slot for rendering content next to the component's labelText.

Styles

NameDescription
--calcite-radio-button-group-gapSpecifies the space between slotted components in the component.
--calcite-radio-button-input-message-spacingSpecifies the margin spacing at the top of the calcite-input-message.

Events

NameDescriptionBehavior
calciteRadioButtonGroupChangeFires when the component has changed.bubblescomposed

Methods

NameDescriptionSignature
componentOnReadyCreates a promise that resolves once the component is fully loaded.componentOnReady(): Promise<this>
setFocusSets focus on the fist focusable calcite-radio-button element in the component.setFocus(options?: FocusOptions): Promise<void>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.