You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/design-system/content/docs/ui-patterns/empty-states.mdx
+36-11Lines changed: 36 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,35 +3,60 @@ title: Empty states
3
3
description: Convey the absence of data and provide clear instruction for what to do about it.
4
4
---
5
5
6
-
At a minimum, empty states convey the fact that there is nothing to list, perform, or display on the current page. They should also provide a clear call to action for the user to take.
6
+
Empty states convey the fact that there is nothing to list, perform, or display on the current page. **Ideally**, they also provide a clear action for the user to take.
7
7
8
8
## Missing route
9
9
10
-
Users may accidentally navigate to a non-existent dynamic route, such as a non-existent bucket in [Storage](https://supabase.com/dashboard/project/_/storage) or a non-existent table in the [Table Editor](https://supabase.com/dashboard/project/_/editor). In these cases, follow the pattern of a centered [Admonition](../fragments/admonition) as shown below..
10
+
Users may accidentally navigate to a non-existent dynamic route, such as a non-existent bucket in [Storage](https://supabase.com/dashboard/project/_/storage) or a non-existent table in the [Table Editor](https://supabase.com/dashboard/project/_/editor). In these cases, follow the pattern of a centered [Admonition](../fragments/admonition) as shown below.
Tabular information without results—or perhaps no data to begin with—should have an empty state that matches the larger presentation.
16
+
There are two ways an empty state may be displayed in cases where there is no data:
17
17
18
-
For instance, a [Table](../components/table) may just display a single row just like it would if it had data. Dulling the TableHead text color and removing the TableCell hover state can further reinforce the lack of usable data.
18
+
-**Zero results**: no data after a search or filter
19
+
-**Initial state**: no data to begin with
20
+
21
+
### Zero results
22
+
23
+
Data-heavy presentations without results should have an empty state that broadly matches the state when there is data. This makes the transition between the two states more seamless.
24
+
25
+
#### Table
26
+
27
+
A [Table](../components/table) instance with zero results should display a single row. Dulling the TableHead text color and removing the TableCell hover state can further reinforce the lack of usable data.
The treatment for other layouts, such as the list of users in [Authentication](https://supabase.com/dashboard/project/_/auth/users), should match their own general styling.
31
+
#### DataGrid
32
+
33
+
[DataGrid](../components/data-table) typically spans the full height and width of a container. A classic example is [Users](https://supabase.com/dashboard/project/_/auth/users), which (as it sounds) displays a list of the project’s registered users. Any instance with zero results should display a more prominent empty with a clear title, description, and supporting illustration.
Other DataGrid instances include [Cron Jobs](https://supabase.com/dashboard/project/_/integrations/cron/jobs) and [Queues](https://supabase.com/dashboard/project/_/integrations/queues).
38
+
39
+
### Initial state
40
+
41
+
Perhaps the user has not yet created any data. The presentation of this empty state depends on the context of the list and the type of data it contains.
42
+
43
+
#### Presentational
44
+
45
+
The user may be learning about a feature for the first time, and this experience benefits from user education or onboarding. In cases like these, the empty state should put more focus on the feature’s value proposition and an action the user can take.
Perhaps the user has not yet created any data yet. They might be a feature for the first time. In these cases, the empty state should provide the briefest information about the lack of data, putting more focus on the value proposition and primary action.
51
+
Or perhaps the list type is data-heavy or does not benefit from additional information. In these cases, the empty state should provide show the initial state in the same presentation as the list when there is data, much like the [zero results](#zero-results) scenario.
Keep in mind that this empty state will likely appear after a visual loading state. Consider layout shift and button placement during and after the transition.
55
+
Keep in mind that empty states will likely appear after a visual loading state. Consider layout shift and button placement during and after the transition.
31
56
32
57
## Components
33
58
34
-
There is not yet a shared empty state UI component. The context and needs for each placement differ enough to warrant custom components for each placement. That said, we should aim to make these as consistent as possible over time. See the below examples that might share common logic in a future centralized component.
59
+
There is not yet a shared empty state UI component. The context and needs for each placement differ enough to warrant custom components for each placement.
0 commit comments