diff --git a/src-docs/src/views/breadcrumbs/breadcrumbs_example.js b/src-docs/src/views/breadcrumbs/breadcrumbs_example.js index 1f0c72bfee3..9d3ec472d66 100644 --- a/src-docs/src/views/breadcrumbs/breadcrumbs_example.js +++ b/src-docs/src/views/breadcrumbs/breadcrumbs_example.js @@ -57,6 +57,13 @@ export const BreadcrumbsExample = { {' '} should be used for application-wide navigation.

+

+ See{' '} + + EuiTabs guidelines + {' '} + if your application requires breadcrumbs and tabs on the same view. +

), sections: [ diff --git a/src-docs/src/views/tabs/tabs_example.js b/src-docs/src/views/tabs/tabs_example.js index 91daf00c723..a5d8ed3aac5 100644 --- a/src-docs/src/views/tabs/tabs_example.js +++ b/src-docs/src/views/tabs/tabs_example.js @@ -9,9 +9,9 @@ import { EuiTab, EuiTabbedContent, EuiText, - EuiLink, } from '../../../../src/components'; +import TabsGuidance from './tabs_guidance'; import { tabsConfig } from './playground'; import Tabs from './tabs'; @@ -31,16 +31,13 @@ const controlledSource = require('!!raw-loader!./controlled'); export const TabsExample = { title: 'Tabs', + guidelines: , intro: (

- Use tabs to organize in-page navigation, segmenting - mutually-exclusive content under a single organizational principle. For - more guideline usage see{' '} - - NNG's article "Tabs, Used Right" - - . + Use tabs to organize related but unique content for a single idea or + subject. Tabs show and hide content using in-page{' '} + navigation UI.

), diff --git a/src-docs/src/views/tabs/tabs_guidance.js b/src-docs/src/views/tabs/tabs_guidance.js new file mode 100644 index 00000000000..63ae1397f89 --- /dev/null +++ b/src-docs/src/views/tabs/tabs_guidance.js @@ -0,0 +1,53 @@ +import React from 'react'; + +import { + EuiCode, + EuiText, + EuiLink, + EuiSpacer, +} from '../../../../src/components'; + +export default () => ( + <> + +

Do

+

+ Follow best practices. Use tabs to organize in-page content. Each tab + should contain a segment of information relevant to the current subject. + For more UX tips see{' '} + + NNG's article "Tabs, Used Right" + + . +

+

Do

+

+ For tabs showing primary page content, use the href{' '} + prop to change the current URL hash. Ensure the tab selection is + persisted in the user's navigation history and works with the browser's + back button. +

+ +

Do

+

+ Ensure when a page is loaded with a URL hash representing a selected tab + (as applied by the href prop), that the corresponding + tab is shown using the selectedTab prop. +

+ +

Don't

+

+ Apply the href prop to change the current page URL + hash on more than one set of tabs per page, or non-primary content. +

+ +

Don't

+

+ Keep users on the same page visually, but change the higher-level + navigation logically. Tabs should keep users at the same place within an + application. Breadcrumbs and main navigation should not change. The URL + hash is the only thing that should change. +

+
+ +);