diff --git a/src-docs/src/routes.js b/src-docs/src/routes.js index 68bfc54aa3c3..29cbf2b2c466 100644 --- a/src-docs/src/routes.js +++ b/src-docs/src/routes.js @@ -24,6 +24,12 @@ import WritingGuidelines import ButtonGuidelines from './views/guidelines/button'; +import ModalGuidelines + from './views/guidelines/modals'; + +import ToastGuidelines + from './views/guidelines/toasts'; + // Services import { IsColorDarkExample } @@ -173,6 +179,12 @@ const guidelines = [{ }, { name: 'Buttons', component: ButtonGuidelines, +}, { + name: 'Modals', + component: ModalGuidelines, +}, { + name: 'Toasts', + component: ToastGuidelines, }]; const createExample = ({ title, intro, sections }) => { diff --git a/src-docs/src/views/guidelines/button.js b/src-docs/src/views/guidelines/button.js index ec6bc151b377..c3ce75a95089 100644 --- a/src-docs/src/views/guidelines/button.js +++ b/src-docs/src/views/guidelines/button.js @@ -3,6 +3,7 @@ import React from 'react'; import { GuidePage, GuideRule, + GuideRuleTitle, GuideRuleExample, } from '../../components'; @@ -33,18 +34,17 @@ export default () => ( Choosing a button type, style, and placement depends on the prominence of its action and the context in which the button appears.
+A modal says “pay attention to me and nothing else.” Modals work best for focusing users' attention on a short +amount of content and getting them to make a decision. +
+ + +Short and sentence-case, it lets the user know the task that needs to get done.
+This task should be critical to continuing the current process.
+The primary action is a filled button, and the secondary action is a link button. +
+It lets the user know that the content behind the modal isn't active.
+Modals pull users out of their current context. + They are well-suited for asking users to confirm an action and for short, focused input. + Otherwise, it's better to show the content within the page. +
+A modal should be a short, direct conversation with the user.
+ If you’re trying to stuff a lot of content into your modal, then you should probably consider
+ a different solution, such as a
+
Don't just pop open a modal. Let a user action, such as clicking a button, trigger a modal.
+Modal content should fit in a single screen. + If your modal has numerous options or a long list of items, use scrolling only + if it's better than other design solutions, + such as keeping the content on the page. +
+Using a modal on top of a modal typically means your workflow is too complex—users shouldn't have
+ to remember which modal they are in. Instead, use a component that supports multiple steps, such as a
+
Users don't expect a toolbar button to open a modal.
++A toast is a short, timely message related to a user action. It appears on the bottom right and times out after a few seconds. + +
++ Username is a required field. +
++ Password must be at least 6 characters long. +
++ Email is a required field. +
+If you are trying to cram a lot of detail into your toast, + then its probably not right design solution. +
+Toasts are a popular design choice because they need not + fit in a layout and they don't disrupt the user. As such, they + are also commonly misued. Don't use toasts + for historical actions or show a toast when the user opens a page. + A toast message should not be a required read before leaving a page. +
+Open one toast at a time so users can take + in all the details before the next toast arrives. +
+