Leave Yamada UI a star

Star
Yamada UIYamada UIv1.7.2

RadioCard

RadioCard is a component used for allowing users to select one option from multiple choices.

Source@yamada-ui/radio

The RadioCard follows the WAI-ARIA - Radio Pattern for accessibility.

If you are not using Fieldset, set aria-label or aria-labelledby to RadioCardGroup.

const items = useMemo<RadioCardItem[]>(
() => [
{ label: "ビアンカ", value: "ビアンカ" },
{ label: "フローラ", value: "フローラ" },
{ label: "ルドマン", value: "ルドマン" },
],
[],
)
return <RadioCardGroup items={items} aria-label="キャラクター" />
Copied!
const items = useMemo<RadioCardItem[]>(
() => [
{ label: "ビアンカ", value: "ビアンカ" },
{ label: "フローラ", value: "フローラ" },
{ label: "ルドマン", value: "ルドマン" },
],
[],
)
return (
<VStack gap="sm">
<Text as="h3" id="label">
キャラクター
</Text>
<RadioCardGroup items={items} aria-labelledby="label" />
</VStack>
)
Copied!

Keyboard Navigation

KeyDescriptionState
TabMoves focus to the checked radio button within the radio group. If no radio button is checked, moves focus to the first radio button.-
SpaceChecks the focused radio button.-
ArrowLeftChecks the previous enabled radio button.-
ArrowRightChecks the next enabled radio button.-
ArrowUpChecks the previous enabled radio button.-
ArrowDownChecks the next enabled radio button.-

ARIA Roles and Attributes

ComponentRoles and AttributesUsage
RadioCardGrouprole="radiogroup"Indicates that this is a radio group.
aria-labelledbyIf RadioCardGroup is within a FormControl and FormControl has a label or Label, set its id.
RadioCardaria-checkedSets to "true" if the radio button is checked, and "false" if it is not checked.

Edit this page on GitHub

PreviousRadioNextCheckbox