Segmented Controls Versus Tabs: Choosing the Right View Switcher in Mac and Web Interfaces
Send Message

Segmented Controls Versus Tabs: Choosing the Right View Switcher in Mac and Web Interfaces

Picking the Right Switcher Before It Breaks Something

A product that confuses these two patterns fails in ways users notice right away. A half-filled form clears itself when someone flips a chart interval. Arrow keys move focus through a loop that promises a new panel and then delivers nothing. A screen reader announces a simple Daily/Weekly/Monthly filter as three separate pages: "tab, 2 of 3," for Weekly, even though only the chart's aggregation changed.

The verdict fits in two sentences. Use a segmented control when the options are different lenses, filters or representations of the same dataset inside one context. Use a tab bar when the options lead to independent, peer-level subsections that share no underlying state.

The test is concrete. Switch the option and look at the screen. If the same record, folder, chart or document is still there and only its presentation changed, you have a segmented control. If the content area now holds unrelated material, you have a tab bar.

Segmented Control vs Tab Bar: Decision Matrix
CriterionSegmented controlTab bar
Data relationshipDifferent lenses, filters or representations of the same object or datasetIndependent, peer-level subsections with separate content and state
Option countRoughly 2 to 5 segments with short labels or iconsExpandable sets that can grow, scroll or overflow
State expectationsSurrounding selection, inputs and scroll survive the changeEach tab keeps its own state and restores it on return
Visual footprintCompact and self-contained, centered or grouped in a toolbar or view headerSpans the width of the content it governs, or sits on a baseline attached to its pane
Platform mappingWeb: radiogroup or native radios. macOS: NSSegmentedControl, SwiftUI Picker with .segmentedWeb: tablist/tab/tabpanel. macOS: NSTabView, SwiftUI TabView

Most mix-ups start when someone picks a switcher by its look. A team that prefers capsules ships a capsule-styled tablist with no panels. A team that prefers underlines ships a segmented control that silently resets scroll position. Shape is a styling decision. The data relationship decides which component you need.

Finder's View Buttons and the Dashboard Test

Why does Finder use a segmented control when Settings uses tabs?

The macOS Human Interface Guidelines describe a segmented control as a linear set of segments that each act like a button and switch between closely related choices or views. Tab views present distinct, peer areas of content in one region of a window.

Finder's toolbar shows the first case. Icon, List, Column and Gallery all render the same folder. Your selection stays put, and the folder you navigated to stays put. Only the arrangement changes. A tabbed preferences window shows the second case. General, Appearance and Advanced have nothing in common beyond living in the same window, and each holds its own controls.

Working through an analytics dashboard

Take a revenue chart in a Mac or web app with an interval switcher for Daily, Weekly and Monthly. Each option re-aggregates one dataset, so it is a lens and calls for a segmented control. One level up, the app separates Revenue, User Retention and Server Health. Those are separate functional areas with their own tables, filters and loading behavior, so they call for tabs. Both switchers can sit on the same screen. They belong to different levels of the hierarchy.

A correct implementation leaves visible evidence. After a segment change, the user's selection, typed filter text and scroll offset are unchanged, and only the chart's representation differs. After leaving a tab and coming back, that tab's scroll position and unsaved inputs are exactly where the user left them. Content from Revenue never leaks into Server Health.

A common failure puts the interval switcher at page level and styles it as tabs. Changing from Weekly to Monthly then wipes the date-range picker and filters that belonged to the chart. Users experience this as the app forgetting what they just did.

When a lens grows into a section

The answer can change. Suppose each interval needs its own controls, its own tables and its own loading flow. At that point the options stop being lenses. Once options in a capsule-styled switcher keep their own scroll offset, unsaved inputs or separate loading states, the control has become a tab bar, however it is drawn. Its markup should move from a radio group or NSSegmentedControl to tablist/tabpanel or NSTabView.

When a lens grows into a section

Wiring Tablists and Radio Groups So the DOM Tells the Truth

Front-end developers usually inherit a visual design and must choose the markup themselves. Often the mockup shows a pill, and the nearest component in the library is a tablist with rounded corners. That shortcut causes most accessibility bugs in view switchers.

The tab group contract

The WAI-ARIA Tabs Pattern specification binds role="tablist", role="tab" and role="tabpanel" elements together. Arrow keys move focus between tabs, and the Tab key moves into the active panel. The wiring looks like this:

<div role="tablist" aria-label="Dashboard sections">
  <button role="tab" id="t-rev" aria-selected="true"
          aria-controls="p-rev" tabindex="0">Revenue</button>
  <button role="tab" id="t-ret" aria-selected="false"
          aria-controls="p-ret" tabindex="-1">Retention</button>
</div>
<div role="tabpanel" id="p-rev" aria-labelledby="t-rev">…</div>
<div role="tabpanel" id="p-ret" aria-labelledby="t-ret" hidden>…</div>

Only the active tab carries tabindex="0". The others carry -1, which produces the roving focus loop.

Then you choose an activation model. Use automatic activation, where selection follows arrow focus, when panel content is already rendered or appears instantly. Use manual activation, where arrows move focus and Space or Enter commits, when switching triggers a fetch or a heavy render. Power users notice the difference, because automatic activation over slow panels fires a request on every keypress.

The lens contract

A view switcher is a single choice from a set, and the web already has an element for that. Native radio inputs inside a fieldset with a legend give the right semantics for free. Arrow keys move and select, and Tab enters and leaves the group at the checked option.

<fieldset class="…">
  <legend>Chart interval</legend>
  <input type="radio" name="iv" id="iv-d" checked><label for="iv-d">Daily</label>
  <input type="radio" name="iv" id="iv-w"><label for="iv-w">Weekly</label>
  <input type="radio" name="iv" id="iv-m"><label for="iv-m">Monthly</label>
</fieldset>

Custom elements can use role="radiogroup" with role="radio" and aria-checked. Toggle buttons with aria-pressed work only inside a labelled group that enforces single selection in script. Without that enforcement, two buttons can end up announced as pressed, or none.

Capsule Over Tablist Trap

A pill-shaped tablist with no tabpanel tells assistive technology that the user is moving to a new region. The aria-controls reference points nowhere useful, and the user hunts for a panel that does not exist. Keep the pill styling and switch the markup to radios.

NSSegmentedControl, TabView, and the Figma Component Behind Them

Starting point: control versus container

In AppKit, NSSegmentedControl is a control. It holds a value and owns no content. NSTabView and NSTabViewController are containers. They always show exactly one item and own that item's view. SwiftUI keeps the same split. A Picker with .pickerStyle(.segmented) binds a selection value and acts as the lens. TabView keeps each tab's content and state separate.

Next step: tracking modes

The trackingMode property shows how wide the segmented control's job really is:

  • selectOne: single selection, the view-switcher case.
  • selectAny: independent toggles, such as bold, italic and underline.
  • momentary: each segment fires an action, as in a back/forward pair or add/remove buttons.

Only selectOne overlaps with tabs in concept, and even then it carries no content. Watch for the reverse disguise as well. NSTabViewController styles such as segmentedControlOnTop and the toolbar style draw tabs that look like segmented controls or toolbar buttons, yet the object underneath is still a tab container with tab-container behavior.

Keyboard testing on the Mac follows different rules. Unless the user has enabled full keyboard navigation in system settings, Tab skips segmented controls and tab views entirely, so run every keyboard pass with that setting both on and off.

In Figma: two distinct anatomies

A segmented control component needs equal-width or proportional cells inside a rounded track, with a raised selected cell. Unselected cells are separated by 1px dividers. The dividers on either side of the selected cell are hidden, so the raised pill reads as a single object. Build that hide rule into variants, or designers will forget it on every instance. A tab bar anchors to a shared baseline or a bar spanning the full width of its pane. The two components should share almost no internal structure.

Advanced: stacking without confusion

Placing a segmented control flush under a window-level tab bar makes it read as secondary navigation. Users then assume the segments lead somewhere. Separate the two levels deliberately. Change the background, enclose the segmented control inside the card or header of the content it filters, or move it into the toolbar. Any one of these tells the eye that the control filters its own content and the tab bar above it navigates.

Advanced: stacking without confusion

When Labels Grow and Windows Shrink

Segmented controls usually size segments equally, so the widest label sets the width of every cell. "Day / Week / Month" fits easily. German adjectival forms such as "Täglich / Wöchentlich / Monatlich" are longer, and some French phrasings run longer still. One long translation widens every segment, and the whole control stretches across the header. You get truncated labels, a toolbar that loses its alignment, or both.

The usual fix is to shrink the font or tighten letter spacing until the labels fit. It hurts legibility, and it produces controls of different sizes in different languages. The control should switch to a fallback instead.

Two fallback rules

Tab bars degrade gracefully. They can scroll horizontally or collapse trailing items into an overflow menu, because users already treat them as a strip of destinations. A segmented control must never scroll internally. When it runs out of room, replace the whole control with a pop-up or pull-down menu, or switch to icon-only segments with tooltips and accessible names. A finished control either shows every option without truncation at the narrowest width in every supported language, or falls back to a menu that still announces its name and current selection.

Fit Before Fallback

A switcher that only works in English at full window width is a problem you have postponed to a later release. Check the longest translation before you approve the control.

Audit your view switchers today

Open your Figma library or front-end component repository and filter for every view switcher with four or more text labels. In each one, replace the copy with localized strings hovering around 35 characters and resize to the narrowest supported window or viewport. Then tab and arrow through the control with a keyboard. Any instance that swaps a panel or resets state is a navigation bar disguised as a segmented control. Rebuild it as a tablist or NSTabView before your next release.

Comments

No comments so far.

Join the Discussion