forked from seb-oss/green
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First version of segmented control (seb-oss#1381)
- Loading branch information
Showing
5 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
apps/docs/content/component/segmentedcontrol/accessibility.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Accessibility | ||
global_id: segmentedcontrolaccessibility | ||
date: 2024-05-21 | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Code | ||
global_id: segmentedcontrolcode | ||
date: 2024-05-21 | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: Design | ||
global_id: segmentedcontroldesign | ||
date: 2024-05-21 | ||
--- | ||
## Anatomy | ||
<Figma node="3241-18803" caption="Anatomy of Segmented control" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
title: Segmented control | ||
summary: A segmented control is a group of 2 – 5 buttons that lets the user switch views or sort elements. | ||
date: 2024-05-21 | ||
global_id: segmentedcontrolindex | ||
status: work in progress | ||
tags: | ||
node: 3241-18797 | ||
--- | ||
## Overview | ||
The segmented control switches between views or to sort elements. | ||
The segmented control is good to use to provide the user with closely related choices that affect an object, state or view. | ||
|
||
## Variants | ||
The segmented control comes in two sizes: | ||
|
||
- **Default**: The most commonly used to ensure visibility. | ||
- **Small**: Used in confined spaces. | ||
|
||
<Grid columns={2} gapInline="small"> | ||
<Figma node="3354-11181" caption="Default size" /> | ||
<Figma node="3354-11183" caption="Small size" /> | ||
</Grid> | ||
|
||
## Behaviour | ||
Component acts as button and trigger a change on click. One option need to be pre-selected, most likely the first. Only one segment can be active simultaneously. | ||
|
||
## Features | ||
|
||
<Grid columns={2} gapInline="small"> | ||
<div> | ||
### Icons | ||
The options may have an icon to accentuate the choices. Use icons sparsely but consistently. | ||
</div> | ||
<Figma node="3354-11216" caption="Options augmented with icons" /> | ||
</Grid> | ||
|
||
<Grid columns={2} gapInline="small"> | ||
<div> | ||
### Overflow | ||
When there isn't enough room for all items to be displayed the items will need to scroll. This is indicated by arrows indicating that there are more options available. | ||
</div> | ||
<Figma node="3354-11368" caption="Overflow of options" /> | ||
</Grid> | ||
|
||
## Do's and Don'ts | ||
<Grid columns={2} gapInline="small"> | ||
<div> | ||
**Do** | ||
- Use max 5 options, try to have as few as possible. | ||
- Keep option size consistent | ||
</div> | ||
<div> | ||
**Don'ts** | ||
- Use it to collect data in a form, in that case use radio button or select. | ||
- Use to navigate in different areas, use tabs for that. | ||
- Mix items with and without icon | ||
- Use it for actions, use buttons instead. | ||
</div> | ||
</Grid> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: UX text | ||
global_id: segmentedcontrolux-text | ||
date: 2024-05-21 | ||
private: true | ||
--- | ||
|