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..b4294782b0b --- /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 () => ( + <> + +

Follow best practices for tabbed interfaces

+

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

+ +

Use props to tailor the user experience

+

+ Tab props allow consumers to set the selected tab on first render, and + add custom behavior on tab click. For instance, you could use the{' '} + selectedTab prop to show a second or third tab on + page load. You could also use the onTabClick prop to + add custom click behavior. +

+ +

Manage the user experience if you change routes or URLs

+

+ Be sure the correct tab is selected if you use the{' '} + href prop to append a hash to the current route. If + your tab adds a #tabbedHash to the URL, the matching + tab should be selected when users refresh the page. It can be confusing + to users when hash routes do not match a selected tab. +

+ +

Tabs must not update higher-level navigation

+

+ Do not update navigation such as{' '} + breadcrumbs or{' '} + navigation menus{' '} + when users click on tabs. Tabs show localized information and it is not + always clear what changed if tabs are below the fold or navigation does + not match the route. +

+
+ +);