department-of-veterans-affairs / va-mobile-app

"If VA were a company, it would have a flagship mobile app."
https://department-of-veterans-affairs.github.io/va-mobile-app/
17 stars 2 forks source link

Common Component Ticket: Segmented Control #4599

Closed htcollier closed 1 year ago

htcollier commented 1 year ago

Intro (title will not be published)

A segmented control is used to switch between related views of information within the same context.

Examples

Default

Alt text goes here

Variations

Alt text goes here

Usage

A segmented control consists of a horizontal set of two or more segments, each of which functions as a button. One option is always selected. The component does not scroll horizontally.

When to use Segmented control

When to consider something else

Placement

Instances of this component in production

Active/Closed claims (see below, left image) and Upcoming/Past Appointments (both are the same data type - segmented control serves as a filter).

On the left is an image of the Segmented Control component in Claims that's a correct usage of the component. Under the image, it says the component serves as a way to filter claims by status. On the right is an image of the Segmented Control component on a Claims detail page. The Segmented Control options are Status and Details. This is not an approved use of the component. Under the image, it says this usage groups content that is dissimilar and you should use the tabs component instead.

Code usage

Add link to Storybook

Content considerations

Accessibility considerations

Related

htcollier commented 1 year ago

@drjecker @TKDickson @dumathane: Ready for committee review.