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

Create empty-states.mdx #58

Closed
wants to merge 10 commits into from
47 changes: 47 additions & 0 deletions pages/design/ui-patterns/empty-states.mdx
@@ -0,0 +1,47 @@
import {Flex, Box, Text, BorderBox} from '@primer/components'

export const meta = {displayName: 'Empty States'}

# Empty States
Empty states appear when there is no content on a page or feature. The blankslate component is used to represent large empty states across our products. These guidelines demonstrate best practices for using the blankslate component and designing empty states. If you're looking for guidelines on implementation, please refer to [Primer CSS](https://primer.style/css/components/blankslate).

## The Blankslate Component
The blankslate is made up of several elements that work together to inform the user about a feature and how to proceed forward. Below are the different elements of the component and how to modify them.

![anatomy](https://user-images.githubusercontent.com/6846673/62644438-f3066f80-b8fe-11e9-8e4b-e8af1cac0e58.png)

### Graphic
The graphic can bring delight, preview an interface element, or represent the goal of the feature. Graphics should be placed intentionally and with thought about the intention of the content. Graphics also differ in meaning and appeal to the user, which is why the blankslate component has multiple variations. These variations are outlined later on this page.

### Primary Text
Primary text is the first piece of information in the empty state presented to the user. It can make a user feel much more comfortable to engage with the content or begin a feature flow. Primary text should sound welcoming, human, and convey the intention of the feature.

### Secondary Text
This optional text is used to inform the user about the feature in more detail. Secondary text should be brief and non-redundant if possible. From the text, users should be able to understand the general purpose of the feature and how it may help them accomplish a goal.

### Primary Action
Blankslates can and are encouraged to use one primary action. This button should lead to a feature or component creation flow. Button copy should be keep brief and descriptive. If a button requires further specification, consider adding an Octicon.

### Secondary Action
Secondary actions are optional and are represented by a text link located below the primary action button. A secondary action is used to direct a user to additional content about the feature. This might look like "[Learn more about X](#)" or "[Check out the guide on X](#)" or simply "[Learn more](#)".

### Border
The border is visible by default and helps define the structure of the blankslate component within the context of the page.

## Variations
Empty states have multiple variations that can be used in different contexts.

### Pictograms
[Pictograms](https://ghicons.github.com/) present a great preview of what should be in place of the empty state. Blankslates should default to using a pictogram for graphic elements.

![pictogram blankslate](https://user-images.githubusercontent.com/6846673/62644441-f39f0600-b8fe-11e9-93da-30aeb0437606.png)

### Illustrations
Illustrations should be used **sparingly** in blankslates - only in cases where it is necessary to evoke emotion from the user. For example, illustrations in a new user experience can help introduce octocats to the user and bring a more personalized experience.

![illustration blankslate](https://user-images.githubusercontent.com/6846673/62645137-796f8100-b900-11e9-9309-39b1f323a5eb.png)

## Content and Copy
Voice and tone are important to making sure users are not only engaged, but also informed about features. Empty states should explain features _in addition_ to conveying intention. Below is a good example of conveying intention in the primary text and using the secondary text to inform.

![code of conduct blankslate](https://user-images.githubusercontent.com/6846673/62644439-f39f0600-b8fe-11e9-9b38-6c75d8f95128.png)