Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs -- tabs extended v2 #1702

Merged
merged 25 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
301fe3a
decription, organization update
RichKummer Oct 12, 2023
0178916
Overview link and mobile image
RichKummer Oct 17, 2023
550c567
Notification
RichKummer Oct 17, 2023
a8c8973
label length info
RichKummer Oct 17, 2023
4a3d0a3
in-line move
RichKummer Oct 17, 2023
0de2a83
Shift content
RichKummer Oct 17, 2023
246bd37
Overview images
RichKummer Oct 17, 2023
4bc1ccd
content guidance
RichKummer Oct 17, 2023
456f98d
reformat page, tabs extended media images
RichKummer Oct 17, 2023
0740bd8
overflow images
RichKummer Oct 17, 2023
2b2b35b
Merge branch 'feat/dotcom-v2' into Docs--tabs-extended
RichKummer Oct 17, 2023
7067c2c
language
RichKummer Oct 19, 2023
87868a5
Merge branch 'feat/dotcom-v2' into Docs--tabs-extended
RichKummer Oct 20, 2023
cb08089
Update src/pages/components/tabs-extended.mdx
RichKummer Nov 1, 2023
ce305be
Update src/pages/components/tabs-extended.mdx
RichKummer Nov 1, 2023
6721984
Update src/pages/components/tabs-extended.mdx
RichKummer Nov 1, 2023
ce54772
12-col img update
RichKummer Nov 1, 2023
36c77db
Merge branch 'Docs--tabs-extended' of https://github.com/carbon-desig…
RichKummer Nov 1, 2023
dd7e7c5
8-col test
RichKummer Nov 2, 2023
2c7118c
Merge branch 'feat/dotcom-v2' into Docs--tabs-extended
RichKummer Nov 2, 2023
c587b14
border update
RichKummer Nov 2, 2023
880a0fc
remove with media images
RichKummer Nov 2, 2023
98dd8b9
Update src/pages/components/tabs-extended.mdx
kennylam Nov 6, 2023
512abfb
Update src/data/components.json
kennylam Nov 6, 2023
4ee5730
Merge branch 'feat/dotcom-v2' into Docs--tabs-extended
RichKummer Nov 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/data/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@
"Tabs extended": {
"url": "/components/tabs-extended",
"designLink": "https://ibm.box.com/s/26zrugvym00408zhpp23gqwnudzmgdd1",
"description": "Tabs extended combines tabs and accordion to organize editorial content.",
"description": "Tabs extended leverages the Carbon tab component with style updates to better organize editorial content.",
"storybook": {
"webcomponents": "https://www.ibm.com/standards/carbon/web-components/?path=/story/components-tabs-extended--default",
"reactwrapper": "https://www.ibm.com/standards/carbon/web-components/react/?path=/story/components-tabs-extended--default"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 29 additions & 62 deletions src/pages/components/tabs-extended.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Tabs extended
description: Tabs extended combines tabs and accordion to organize editorial content.
description: Tabs extended leverages the Carbon tab component with style updates to better organize editorial content.
---

import ComponentDescription from 'components/ComponentDescription';
Expand All @@ -15,107 +15,74 @@ import ResourceLinks from 'components/ResourceLinks';

<AnchorLinks>
<AnchorLink>Overview</AnchorLink>
<AnchorLink>Tabs extended</AnchorLink>
<AnchorLink>Tabs extended media</AnchorLink>
<AnchorLink>Behaviors</AnchorLink>
<AnchorLink>Resources</AnchorLink>
<AnchorLink>Content guidance</AnchorLink>
<AnchorLink>Feedback</AnchorLink>
</AnchorLinks>

## Overview
<InlineNotification>

Tabs are useful for displaying parallel pieces of content that share the same context. It has the additional benefit of reducing screen height, but should be used carefully because some information is hidden on load.
**Breaking change:** Previously, tabs extended was a separate component in Carbon for IBM.com v1. In v2, tabs extended will use Carbon Design System's [tab](https://carbondesignsystem.com/components/tabs/usage/) directly with automatic style updates.

Our Tabs extended component references the Carbon Design System's [tabs component](https://carbondesignsystem.com/components/tabs/usage/), and it is built with additional features to optimize for editorial content.
</InlineNotification>

## Tabs extended
## Overview

On desktop, Tabs extended renders as tabs. On mobile, the component renders as an accordion, making it easy to read and access each section while scrolling.
Tabs extended displays parallel pieces of related content, allowing users to explore the displayed content of their choice. It also has the benefit of reducing the amount of scrolling the user may have to do on a given page, but should be used carefully because some information is hidden on load. If the information within a tab is essential for the user, consider using a different component that will not hide the content.

Tab labels wrap up to two lines before being truncated. Truncated labels are fully displayed in tooltips on hover and focus.
The tabs extended component uses the Carbon Design System's [tabs](https://carbondesignsystem.com/components/tabs/usage/) component directly, and includes automatic style updates to optimize for editorial content.

<Row>
<Column colMd={8} colLg={8}>
RichKummer marked this conversation as resolved.
Show resolved Hide resolved

![Image of Tabs extended component on desktop](../../images/component/tabs-extended/components--tabs-extended-1.png)
![Image of Tabs extended component on desktop. Tabs extended displays a set of options with different labels, with one option in semibold type to indicate that it is selected](../../images/component/tabs-extended/tabs-extended-overview-01.png)

<Caption>Example of the tabs extended, on desktop</Caption>
<Caption>Example of tabs extended on desktop</Caption>

</Column>
</Row>

On mobile, Tabs extended switches to an accordion for easier browsing.

<Row>
<Column colMd={6} colLg={4}>

![Image of Tabs extended component on `sm`](../../images/component/tabs-extended/components--tabs-extended-3.png)
#### Tab labels

<Caption>Example of the tabs extended, on mobile</Caption>
Like tabs, each tab label is set to auto-width and will vary based on the label's character count, and will have consistent padding on either side of the label. Keep this in mind as you write labels for each tab, as overly long labels can push other options out of the initial view. Also consider that translation will generally lengthen the label, reference the [content guidance table](### content-guidance-for-tabs-extended) for best practices.

</Column>
</Row>
Tabs extended can nest other components inside its content area to display them based on the user's selection. We recommend nesting similar components in sequence, rather than varying the types of components displayed in a given tabs experience.

### Modifiers
## Behaviors
RichKummer marked this conversation as resolved.
Show resolved Hide resolved

#### Orientation
### Overflow

Tabs orientation on desktop can be set to horizontal or vertical. When using the vertical orientation, the tabs are displayed stacked in one column. This allows for longer tab labels.
When the tabs extended options would be hidden due to the window becoming too small, overflow buttons will automatically appear on the sides of the component. These buttons allow users to navigate the entire tabs extended to see all options regardless of screen size. Note that this functionality occurs across all breakpoints, not just mobile.

<Row>
<Column colMd={8} colLg={8}>

![Image of Tabs extended component on `sm`](../../images/component/tabs-extended/components--tabs-extended-2.png)

<Caption>Example of the tabs extended using vertical orientation</Caption>

</Column>
</Row>

<ResourceLinks name="Tabs extended" type="ui" multiComponent />

### Content guidance for Tabs extended

| Element | Content type | Required | Instances | Character limit <br/>(English / translated) | Notes |
| ---------------------------------------------------------------------------------------------------------------------- | ------------ | -------- | --------- | ------------------------------------------- | --------------------------------------------------------------------------------------------- |
| Child container | Component | Yes | Min 2 | – | Container areas that child components and other content types can be passed into (1 per tab). |
| <a href="https://www.carbondesignsystem.com/components/tabs/usage/" target="_blank" rel="noopener noreferrer">Tabs</a> | Component | Yes | 2–6 | – | Tab renders as an accordion for medium breakpoint and smaller. |
| Tab item | Text | Yes | – | 25 / 35 | When using vertical orientation max character count = 40 / 55. |

For more information, see the [character count standards](https://www.ibm.com/standards/carbon/guidelines/content#character-count-standards).

## Tabs extended with media

Tabs extended with media provides an option where the tab panel is pre-populated with the [Content item row](/components/content-item-row) with media component to create an organized section for displaying content paired with media. Keep in mind that when using tabs, some content will be hidden until the user interacts with the component, so they should not be used for information that is considered critical.

<Row>
<Column colMd={8} colLg={8}>

![Image of Tabs extended with media component](../../images/component/tabs-extended/components--tabs-extended-media-1.png)
![Tabs extended with an overflow on desktop, in which case an overflow button appears to indicate that there is more content out of view](../../images/component/tabs-extended/tabs-extended-behavior-01.png)
RichKummer marked this conversation as resolved.
Show resolved Hide resolved

<Caption>Example of the tabs extended media, on desktop</Caption>
<Caption>Tabs extended with an overflow on desktop</Caption>

</Column>
</Row>

On mobile, Tabs extended media renders as an accordion for easier browsing.

<Row>
<Column colMd={4} colLg={4}>

![Image of Tabs extended media component](../../images/component/tabs-extended/components--tabs-extended-media-2.png)
![Tabs extended with an overflow on mobile, in which case an overflow button appears to indicate that there is more content out of view](../../images/component/tabs-extended/tabs-extended-behavior-02.png)

<Caption>Example of the tabs extended media, on mobile</Caption>
<Caption>Tabs extended with an overflow on mobile</Caption>

</Column>

</Row>

<ResourceLinks name="Tabs extended media" type="layout" multiComponent />
<ResourceLinks name="Tabs extended" type="ui" />

### Content guidance for Tabs extended media
## Content guidance for Tabs extended

| Element | Content type | Required | Instances | Character limit <br/>(English / translated) | Notes |
| --------------------------------------------------------------------------------------------------------------------------- | ------------ | -------- | --------- | ------------------------------------------- | -------------- |
| Tabs extended | Component | Yes | 1 | – | |
| [Content item row with media](https://www.ibm.com/standards/carbon/components/content-item-row#content-item-row-with-media) | Component | Yes | 1 | – | Max 1 per tab. |
| Element | Content type | Required | Instances | Character limit <br/>(English / translated) | Notes |
| ---------------------------------------------------------------------------------------------------------------------- | ------------ | -------- | --------- | ------------------------------------------- | --------------------------------------------------------------------------------------------- |
| <a href="https://www.carbondesignsystem.com/components/tabs/usage/" target="_blank" rel="noopener noreferrer">Tabs</a> | Component | Yes | 2–6 | 25 / 35 | |
| Child container | Component | Yes | Min 2 | – | Container areas that child components and other content types can be passed into (1 per tab). |

For more information, see the [character count standards](https://www.ibm.com/standards/carbon/guidelines/content#character-count-standards).

Expand Down