-
Notifications
You must be signed in to change notification settings - Fork 861
[EUI+] Add missing guidelines #8309
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
Merged
weronikaolejniczak
merged 9 commits into
elastic:main
from
weronikaolejniczak:fix/eui-plus-missing-content
Feb 21, 2025
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2bc584d
fix(website): add missing guidelines pages
weronikaolejniczak 8284ce5
fix(website): disable responsive behavior in selection controls basic…
weronikaolejniczak 925a1e4
fix(website): make panels equal in height, change incorrect don't to do
weronikaolejniczak f79c0ea
fix(website): fix typo in Toast guidelines
weronikaolejniczak 0f0ae20
fix(website): fix redirection to Toast guidelines
weronikaolejniczak 9052665
fix(website): fix EmptyPrompt guidelines redirection
weronikaolejniczak 5b34e63
fix(website): set block-size to initial for EuiKeyPadMenuItem
weronikaolejniczak 208b739
Merge branch 'main' into fix/eui-plus-missing-content
weronikaolejniczak 8815898
fix(website): move text inline with EuiButton in toast guidelines
weronikaolejniczak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
101 changes: 101 additions & 0 deletions
101
packages/website/docs/components/display/empty_prompt/guidelines.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,101 @@ | ||
| --- | ||
| slug: /display/empty-prompt/guidelines | ||
| id: display_empty_prompt_guidelines | ||
| title: Empty prompt guidelines | ||
| sidebar_label: Guidelines | ||
| --- | ||
|
|
||
| import { EuiFlexGroup } from '@elastic/eui'; | ||
|
|
||
| ## Anatomy | ||
|
|
||
| A useful empty state will let the user know what's happening, why it's happening, and what to do about it. It can contribute to a more compelling user experience and add more value to the business if done right. | ||
|
|
||
| To make the empty state clear, follow this pattern: | ||
|
|
||
| import { EuiAspectRatio } from '@elastic/eui'; | ||
|
|
||
| <EuiAspectRatio width={16} height={9}> | ||
| <iframe | ||
| title="Anatomy of an empty state" | ||
| width="1200" | ||
| height="550" | ||
| src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FRzfYLj2xmH9K7gQtbSKygn%2FElastic-UI%3Fnode-id%3D22764%253A276515" | ||
| /> | ||
| </EuiAspectRatio> | ||
|
|
||
| 1. **Icon or illustration (optional):** A meaningful representation of the the solution or context. | ||
| 2. **Title:** Answers the question "What's happening?". Is it an error? Is it loading? | ||
| 3. **Description:** Why is it happening? Explain why the space is empty and guide the users through the required actions. | ||
| 4. **Action(s):** Your call to actions should answer the question "What will solve the issue?". Lead the users to take action or guide them about the next steps. | ||
| 5. **Footer (optional):** Use this section to reference documentation or link to an area where users can learn more about the issue they are facing. | ||
|
|
||
| ## Empty state types, goals, and recommendations | ||
|
|
||
| The following scenarios detail the most common empty states use cases and provide recommendations for use with **EuiPageTemplate**. | ||
|
|
||
| import { TypesOfEmptyStates } from './types_of_empty_states'; | ||
|
|
||
| <TypesOfEmptyStates /> | ||
|
|
||
| ## Design | ||
|
|
||
| ### Vertical vs. horizontal | ||
|
|
||
| The vertical layout is perfect when the content is small — a title and two paragraphs at most. You can use this layout with an icon, an illustration, or no icons at all. | ||
|
|
||
| Use the horizontal layout when you have a long description, multiple calls to action, and a footer. For this type of layout, an illustration is required. | ||
|
|
||
| <EuiFlexGroup gutterSize="m"> | ||
| <Guideline text="Use the vertical layout when the text is 1 to 2 sentences."> | ||
weronikaolejniczak marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|  | ||
| </Guideline> | ||
| <Guideline text="Use the horizontal layout when you have a long description, and you can provide an illustration."> | ||
|  | ||
| </Guideline> | ||
| </EuiFlexGroup> | ||
|
|
||
| ### Icons and illustrations | ||
|
|
||
| Icons and illustrations must first and foremost communicate meaning. They are also an opportunity to delight users and show our Elastic brand. | ||
|
|
||
| When using an illustration, bear in mind that they stand out a lot. Use one illustration per page. Having multiple illustrations might make the page too crowded. | ||
|
|
||
| <EuiFlexGroup gutterSize="m"> | ||
| <Guideline type="do" text="An illustration works better in a horizontal layout."> | ||
|  | ||
| </Guideline> | ||
| <Guideline type="dont" text="Avoid using icons and illustrations that don't mean anything and are not related to the content."> | ||
|  | ||
| </Guideline> | ||
| </EuiFlexGroup> | ||
|
|
||
| ### Learn more links | ||
|
|
||
| "Learn more" links are optional. You can use them in your empty prompt to link to documentation where users can get more detailed help. | ||
|
|
||
| Include the link after the description when the empty prompt doesn't contain a call to action. If there is a call to action, include the link in the footer. | ||
|
|
||
| <EuiFlexGroup gutterSize="m"> | ||
| <Guideline text={`Add the "Learn more" link after the description when the empty prompt doesn't contain a call to action.`}> | ||
|  | ||
| </Guideline> | ||
| <Guideline text={`Add the "Learn more" link in the footer when the empty prompt contains a call to action.`}> | ||
|  | ||
| </Guideline> | ||
| </EuiFlexGroup> | ||
|
|
||
| ### Multiple empty states | ||
|
|
||
| When a page has multiple empty states, avoid using multiple primary actions and multiple icons or illustrations. | ||
|
|
||
| Use secondary actions and no icons or illustrations. This way, the visual noise will be reduced. Consider using an illustration or a primary action if you want to make one of the empty states stand out. | ||
|
|
||
| <EuiFlexGroup gutterSize="m"> | ||
| <Guideline type="do" text="Use secondary actions and no icons or illustrations when displaying multiple empty states."> | ||
|  | ||
| </Guideline> | ||
| <Guideline type="dont" text="Avoid mixing different types of empty states. Be consistent."> | ||
|  | ||
| </Guideline> | ||
| </EuiFlexGroup> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
packages/website/docs/components/display/empty_prompt/types_of_empty_states/colors.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import { EuiCode } from '@elastic/eui'; | ||
|
|
||
| export const TYPES_OF_PANEL_COLORS = { | ||
| sidebar: { | ||
| id: 'sidebar', | ||
| text: ( | ||
| <> | ||
| <p> | ||
| Set <EuiCode>{'color="subdued"'}</EuiCode> to make users not getting | ||
| distracted and focus on the content. | ||
| </p> | ||
| <p> | ||
| Consider the transparent color if the empty prompt is contained in | ||
| another component. | ||
| </p> | ||
| </> | ||
| ), | ||
| props: { color: 'subdued' }, | ||
| }, | ||
| empty: { | ||
| id: 'empty', | ||
| text: ( | ||
| <> | ||
| <p> | ||
| Set <EuiCode>{'color="plain”'}</EuiCode> to make users getting focus | ||
| on the content | ||
| </p> | ||
| <p> | ||
| Consider the transparent color if the empty prompt is contained in | ||
| another component. | ||
| </p> | ||
| </> | ||
| ), | ||
| props: { color: 'plain' }, | ||
| }, | ||
| multiple: { | ||
| id: 'multiple', | ||
| text: ( | ||
| <> | ||
| <p> | ||
| Set <EuiCode>{'color="plain” and hasBorder={true}'}</EuiCode> when you | ||
| have multiple panels on the page. The other panels should also have | ||
| borders to ensure consistency. | ||
| </p> | ||
| <p> | ||
| Consider the transparent color if the empty prompt is contained in | ||
| another component. | ||
| </p> | ||
| </> | ||
| ), | ||
| }, | ||
| error: { | ||
| id: 'error', | ||
| text: ( | ||
| <p> | ||
| Set <EuiCode>{'color="danger"'}</EuiCode> to emphasize that an error | ||
| happened. | ||
| </p> | ||
| ), | ||
| }, | ||
| } as const; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.