components
Tabs
v.1.0.0 | SaturnComponents
Play with the component with our playground.
Anatomy
Name | Description |
---|---|
1 Required | width height |
2 Required | border top: 2px solid. Applies to the selected tab. |
3 Required | Describes the action that will occur if a user taps a tab. |
4 | width height |
5 | Describes the action that will occur if a user taps a tab. |
States
SelectedA color line communicates the tab selected.
UnselectedBlue background communicates the tab is not selected.
Keyboard focus - SelectedA keyboard focus state communicates when a user has highlighted an element, using an input method such as a keyboard or voice. A color line communicates the tab selected.
Keyboard focus - UnselectedA keyboard focus state communicates when a user has highlighted an element, using an input method such as a keyboard or voice. A grey line communicates the tab unselected.
Behaviour
SizeThe tab is bounded by parent element. So if there is only one tab, it will occupy 100% of the element containing it. It there are two, for example, they will occupy 1/2 of 100%.
How text growsIt is recommended that the text on the tabs occupy no more than a single line, but they can use a second line if necessary, with truncated text. If one tab has more content than the others, the rest of the tabs will increase their height to maintain the same proportions.
Navigate between tabsUsers can navigate between tabs by clicking or tapping a tab.
Mobile
Horizontal scrollOnly mobile. When the content exceeds the width of the screen it will generate a horizontal scroll. at a resolution of 320px, two 140px tabs will be displayed. Arrows must be applied to make tabs accesible.
Do's and dont's
Do’s
It is recommended that the text on the tabs occupy no more than a single line, but they can use a second line if necessary, with truncated text.
Don’t
The text in the tabs cannot be longer than two lines. If necessary, the text can be truncated.
Do’s
If one tab has more content than the others, the rest of the tabs will increase their height to maintain the same proportions.
Don’t
If one tab has more content than the others, the rest of the tabs cannot have a fixed height.
Don’t
Use too many tabs.