Leave Yamada UI a star

Star
Yamada UIYamada UIv1.6.4

SegmentedControl

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

Source@yamada-ui/segmented-control

When using only icons in SegmentedControlButton, set aria-label for the SegmentedControlButton.

<Wrap gap="md">
<SegmentedControl>
<SegmentedControlButton aria-label="plus" value="plus">
<Plus />
</SegmentedControlButton>
<SegmentedControlButton aria-label="minus" value="minus">
<Minus />
</SegmentedControlButton>
</SegmentedControl>
</Wrap>
Copied!

Keyboard Navigation

KeyDescriptionState
TabFocuses the selected item.-
ArrowLeftFocuses the previous item that is not disabled. If it's the first item, it focuses the last item that is not disabled.-
ArrowRightFocuses the next item that is not disabled. If it's the last item, it focuses the first item that is not disabled.-

ARIA Roles and Attributes

ComponentRoles and AttributesUsage
SegmentedControlrole="radiogroup"Indicates that this is a radio group.
SegmentedControlButtonrole="radio"Indicates that this is a radio.
aria-disabled="true"Sets "true" if isDisabled is set to "true".

Edit this page on GitHub

PreviousRatingNextData Display