On this page
Tabs and segmented controls often look similar: a short row of labels, one highlighted option, and a changing region underneath. Their jobs can be quite different. Tabs reveal related content panels. A segmented control commonly selects a value or display mode. Getting that distinction right makes the interface easier to label, implement, and extend.
Decide whether people are navigating or choosing
Describe what changes after activation. If “Overview” reveals an overview panel while “Activity” reveals activity, content switching is probably the right model. If “Monthly” changes a billing preference or “Compact” changes display density, the component represents a choice. Appearance alone should not determine its semantics.
Use the contrast checker to compare label colors and selected indicators against their backgrounds. Check unselected text too; it still names an available destination or value. Test the actual surface colors in both themes instead of assuming the highlighted segment makes everything readable.
A segmented control is a visual arrangement, not a single universal HTML element or ARIA role. Its underlying behavior might be a radio group, tabs, or ordinary navigation links. Document the intended interaction in the component specification. The design tokens guide can help keep the appearance consistent without conflating different behaviors.
Do not use either pattern to conceal an arbitrary collection of unrelated commands. “Overview / Delete / Export” mixes navigation and actions. Separate the commands so selecting a panel never risks triggering a destructive operation.
Use tabs for related panels, not every destination
Tabs work when people need to move among sibling views within a stable context: account details, activity, and permissions for the same account, for example. The surrounding title and identity should remain clear while the panel changes. This makes the relationship between the views understandable.
Avoid hiding information that must be compared simultaneously. If people need to inspect shipping and billing addresses together, separate cards may serve them better than mutually exclusive panels. Tabs trade simultaneous visibility for a smaller footprint; make that trade intentionally.
Keep labels short, concrete, and parallel. “Overview,” “Members,” and “Settings” are easier to scan than a mixture of vague verbs and full questions. Counts can add useful context, but reserve room for changing values. A label that jumps sideways every time a count changes makes repeated interaction harder.
Use normal links for site navigation when each item is fundamentally a separate destination. A tab-like visual style does not require tab roles. If you implement an actual tab interface, follow the WAI tabs pattern for the relationship among the tab list, tabs, and panels.
Keep panels free of unexpected side effects. Merely visiting “Notifications” should not save a preference, delete an alert, or clear a filter unless that behavior is clearly part of the product contract.
Use segmented choices for small, related option sets
A single-choice group is appropriate for options such as list versus grid, day versus week, or a small set of display densities. Each option should answer the same question. “Comfortable / Compact” answers “Which density?” while “Compact / Export” does not.
As a working rule, start with two to five brief choices that fit without squeezing. This is a design heuristic, not a technical limit. If labels become long or the choices grow frequently, radios, a select, or another explicit control may communicate the decision better.
Use native radios when selecting one persistent value from a mutually exclusive set. A fieldset legend gives the group a question, while individual labels name the answers. The MDN radio input reference explains the shared-name behavior that enforces exclusivity.
<fieldset class="density-picker">
<legend>Display density</legend>
<label>
<input type="radio" name="density" value="comfortable" checked>
<span>Comfortable</span>
</label>
<label>
<input type="radio" name="density" value="compact">
<span>Compact</span>
</label>
</fieldset>Style the labels as adjoining segments while retaining the native controls and visible focus feedback. Do not hide inputs with display: none and then expect their keyboard behavior to remain available. If the product requires a save step, keep it explicit; a visually immediate mode switch and a form field awaiting submission should not look deceptively identical.
Make selected, focused, and disabled states distinct
The selected state answers “Which view or value is active?” The focus indicator answers “Where will my next keyboard action go?” They may appear on different options simultaneously. Combining both into one colored background creates ambiguity for keyboard users.
Use more than a subtle hue shift for selection. A filled surface, an underline, a weight change, or a persistent marker can reinforce the active label. Keep the indicator strong enough to find without making the unselected labels appear unavailable. Review the WCAG use-of-color explanation when checking whether color carries the entire distinction.
Give each option sufficient padding for comfortable targeting. A row height around 44 pixels is a useful starting point for touch interfaces, not a blanket compliance claim. Leave enough room for the focus outline and avoid clipping it inside a rounded outer container.
Disabled options should be uncommon and explained where the reason matters. An unavailable “Analytics” panel with no explanation may look broken. If access depends on permission or setup, provide that context nearby instead of relying on a tooltip that only appears on hover.
Plan keyboard behavior and narrow layouts
For actual tabs, keyboard focus typically enters the active tab, then arrow keys move among tabs. Depending on the activation model, focus movement either selects immediately or requires Enter or Space. Manual activation is often safer when panel loading introduces noticeable latency. Match the implementation to the WAI pattern rather than wiring every tab as an unrelated button.
For native radio groups, preserve platform keyboard behavior instead of layering a competing tab-style handler on top. Test focus movement, selection, and submission with the same data flow the production component will use. The practical accessible interfaces guide offers a broader review checklist.
On narrow screens, avoid wrapping a horizontal tab row into several ambiguous rows. Consider horizontal overflow with a clear scroll affordance, fewer visible labels, or a deliberately redesigned alternative. Ensure the selected tab scrolls into view and that scrolling does not hide the panel heading.
Define state persistence as well. A billing preference may belong to saved account settings; a density choice may be local; a content tab may need a shareable URL. Test refresh, Back, and reopening the screen. These behaviors matter as much as the selected pill's radius, and they should be documented before the component becomes a shared default.
Key takeaways
- Distinguish content switching from choosing a value before styling.
- Use tabs for sibling panels within a stable context.
- Keep segmented choices short, related, and genuinely exclusive.
- Show selection and keyboard focus as separate states.
- Specify responsive behavior, activation, and persistence together.
Reach designers & developers at work
Put your product next to the tools people use every day. One sponsor per placement, no tracking pixels.
Become a sponsor