Control the state of an object or the visibility of section content
Screenshot 1 - Controlling a Chart
Screenshot 2 - Branching Content
Introduction
Segmented buttons are a list of JavaScript-based buttons; their purpose is to control the state of an object (e.g. a chart) or the visibility of section content (e.g. branching content).
Best Practices
Segmented buttons are not form controls; although they can be used within a form to provide branching capabilties, they do not store and submit form data.
Segmented buttons are not a drop-in replacement for tabs, nor do they operate like tabs. Tabs and Segmented Buttons solve two different problems.
Terminology
Segmented Buttons: The pattern as a whole, a list containing two or more segments (upto a maxium of four)
Segment: A regular HTML button (type=button)
Current Segment: The button in the group that is currently active
Even though visually styled as a group, each button has normal button interactions (i.e. they each live in the normal tab order of the page) that triggers arbitrary JavaScript logic.
The only thing to set them apart from a normal button, is that "clicking" one segment will unset the current segment (the state is conveyed with the aria-current attribute).
Developer Guide 1 - Controlling a Chart
The segmented buttons are formed together in a list, with one button marked as current:
Under development.
Developer Guide 2 - Controlling Page Flow
Again, the segmented buttons are formed together in a list, with one button marked as current: