mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
* docs * naming * docs * mini fix * update policies component * use destructured prop * rls policies dialogs * custom domain dialogs * restart server dialog * remove ConfirmDialog (aka ConfirmModal) * docs updates * remove unrelated work * remove unrelated work * remove unrelated work * confirmation-modal demo * use indicative components * links * tiny docs updates * examples * sheets and alert dialog examples * docs and examples * docs * docs * text confirm modal * docs * docs * revert cursor rules * fixes * fix links * Update apps/design-system/registry/examples.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * rabbit * rabbit * use variants --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
36 lines
1.6 KiB
Plaintext
36 lines
1.6 KiB
Plaintext
---
|
||
title: Empty State Presentational
|
||
description: An empty state for encouraging action.
|
||
component: true
|
||
fragment: true
|
||
---
|
||
|
||
<ComponentPreview name="empty-state-presentational-icon" peekCode />
|
||
|
||
Expects a title, description, and optional action buttons or other children.
|
||
|
||
## Props
|
||
|
||
### Text
|
||
|
||
All text should be written using active language. The title should prompt the user to take an action, and the description should clearly explain the value of doing so.
|
||
|
||
### Icon
|
||
|
||
Supports both Lucide icons and [custom icons](../icons) via the `icons` package. If neither are passed, Empty State Presentational falls back to Lucide’s `SquarePlus`.
|
||
|
||
<ComponentPreview name="empty-state-presentational-demo" peekCode />
|
||
|
||
See also [Empty States](../ui-patterns/empty-states).
|
||
|
||
## Examples
|
||
|
||
It’s okay to repeat buttons inside of Empty State Presentational that are also available outside of it. The alternative is to conditionally determine button placement whilst polling for list length (to determine whether to show an empty state or not). This is problematic for two reasons:
|
||
|
||
1. Rendering after client-side polling often leads to confusing layout shift. This layout shift becomes exacerbated when buttons are stacked against other objects.
|
||
2. Consistent entry points outside of Empty State Presentational also teach a pattern that will continue to exist post initial object creation.
|
||
|
||
When repeating buttons, set the `type` to `default` so the original `primary`, button remains the only `primary` action on display.
|
||
|
||
<ComponentPreview name="empty-state-presentational-buttons" peekCode />
|