Skip to main content

Radio

Use cases:

  • Selecting exactly one from multiple options in the same input

Example​

Radio

Declaration

<Radio>Radio</Radio>

Usage

import { Radio } from '@genesislcap/rapid-design-system/react';

export function MyComponent() {
const handleRadioFieldChanged = (event) => {
const target = event.target as HTMLInputElement;
console.log(target.value);
};
return (
<Radio onChange={handleRadioFieldChanged}>
Radio
</Radio>
);
}

API​

Property and attribute binding examples for Genesis Component syntax.

NameTypeDescriptionExample
checkedbooleanSets or retrieves the current state of the component. Default: false
<rapid-radio checked>
disabledbooleanSimilar to readonly, but with a blur on the component
<rapid-radio disabled>
valuestringSets a value for the component. Not visible to the user
<rapid-radio
value=${sync((x) => x.radioValue)}>
readonlybooleanIf true, the user cannot change the value of this checkbox (which is greyed out)
<rapid-radio readonly>

Properties​

This component doesn't have any properties which are not also controlled via attributes.

Slots​

SlotUse
checked-indicatorThe checked indicator

Parts​

PartDescription
controlThe element representing the visual radio control
labelThe label
checked-indicatorThe checked indicator (requires the default checked-indicator slot to be present)

Events fired​

NameDescription
@changeFires the event when the radio component changes its state

Events listened to​

This component doesn't listen to any events.

Further details​

This component is an implementation of an HTML radio element.