Skip to content

Preferred / most accessible way to create a segmented control with react-aria-components? #7274

Answered by devongovett
schurchleycci asked this question in Q&A
Discussion options

You must be logged in to vote

We're about to add a ToggleButtonGroup component for this (see #7264), but a RadioGroup also works if you only need single selection. TagGroup and GridList are probably overkill.

Depending on your UI, you could potentially also use Tabs. If the segmented control swaps an associated view between different content, then Tabs would be appropriate. If it's making a selection (like bold/italic/underline buttons), or swapping between views of the same content (e.g. table vs cards of the same items), then ToggleButtonGroup (eventually) or RadioGroup would be more appropriate.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@schurchleycci
Comment options

Answer selected by schurchleycci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants