Once UI Handbook
Beginner Guides
What is Once UI?
Install & config
Page skeleton
Your first page
Build And Launch
How to launch a portfolio site that actually gets you hired
How to build a documentation site with MDX and Next.js
How to ship a landing page and dashboard with authentication in Next.js
How to launch a social app with Next.js and Supabase
Vibe Coding
Introduction to vibe coding
Set up your local dev environment
Essential tools for vibe coding
Build your first Once UI app
Common Patterns
Hero section
Static panel
Form layout
Highlighted card
Responsive stacking
Decoration layers
Dialog & modal
Toast & feedback
Tables & lists
Loading states
App shell navigation
Dashboard & charts
Chat & messaging
Auth & verification
Settings & split panels
Data filters & toolbar
Command palette
Pricing & plans
Accordion & FAQ
Media & uploads
Empty & error states
SEO, Open Graph, and structured data
Documentation code blocks with live preview
Carousels, galleries, and before/after comparisons
Date pickers and scheduling
Context menus and dropdown actions
Tags, chips, and multi-value inputs
Roadmap & kanban
Form inputs & controls
Progress, status & badges
Scrolling & feeds
Profile, avatars & identity
Social proof & logo clouds
Masonry & media grids
Table pagination, search & bulk selection
Banners & announcements
Footer layouts
Onboarding & first run
Waitlist & coming soon
Design Tips
Color & surfaces
Harness overview
Row, Column & Grid
Spacing & rhythm
Icons & buttons
Reveal & motion
Theme tokens, FOUC-free init, and runtime style controls
Tooltips and hover cards
Block updates
Block updates changelog
Agent Resources
Column, not Flex
Semantics over CSS
Typography scale
Common gotchas
Block anchors
Validate generated code
Pro block registry
Match task bundles
TrademarkTrademark
Ctrl k
Search...
Sign up
Once UI Handbook
Beginner Guides
What is Once UI?
Install & config
Page skeleton
Your first page
Build And Launch
How to launch a portfolio site that actually gets you hired
How to build a documentation site with MDX and Next.js
How to ship a landing page and dashboard with authentication in Next.js
How to launch a social app with Next.js and Supabase
Vibe Coding
Introduction to vibe coding
Set up your local dev environment
Essential tools for vibe coding
Build your first Once UI app
Common Patterns
Hero section
Static panel
Form layout
Highlighted card
Responsive stacking
Decoration layers
Dialog & modal
Toast & feedback
Tables & lists
Loading states
App shell navigation
Dashboard & charts
Chat & messaging
Auth & verification
Settings & split panels
Data filters & toolbar
Command palette
Pricing & plans
Accordion & FAQ
Media & uploads
Empty & error states
SEO, Open Graph, and structured data
Documentation code blocks with live preview
Carousels, galleries, and before/after comparisons
Date pickers and scheduling
Context menus and dropdown actions
Tags, chips, and multi-value inputs
Roadmap & kanban
Form inputs & controls
Progress, status & badges
Scrolling & feeds
Profile, avatars & identity
Social proof & logo clouds
Masonry & media grids
Table pagination, search & bulk selection
Banners & announcements
Footer layouts
Onboarding & first run
Waitlist & coming soon
Design Tips
Color & surfaces
Harness overview
Row, Column & Grid
Spacing & rhythm
Icons & buttons
Reveal & motion
Theme tokens, FOUC-free init, and runtime style controls
Tooltips and hover cards
Block updates
Block updates changelog
Agent Resources
Column, not Flex
Semantics over CSS
Typography scale
Common gotchas
Block anchors
Validate generated code
Pro block registry
Match task bundles
TrademarkTrademark
Once UIDocumentationBlog
© Once UI. All rights reserved.
Built with Aveiro

Empty & error states

Compose empty, error, and filtered-empty states with Icon, Heading, Text, and Button — distinct from loading skeletons.
Updated 19d ago
Media & uploads
SEO, Open Graph, and structured data
5 min · Pattern
Empty and error states tell users what happened and what to do next. Compose them with Column, Icon, Heading, Text, and Button — not generic placeholder divs.

What this pattern covers

Every data-driven UI needs three non-happy paths:
  • Empty — query succeeded but returned zero results
  • Error — fetch failed or action was rejected
  • No access — user lacks permission to view content
These are different from loading states (skeletons and spinners). Show empty/error only after the request resolves.

Empty state anatomy

A good empty state has four parts:
  • Icon or illustration (muted, not decorative)
  • Heading — what is empty
  • Text — why it might be empty or what to do
  • Primary action Button (optional secondary)
<Column fillWidth center padding="48" gap="16" maxWidth="xs">
  <Icon name="inbox" size="l" onBackground="neutral-weak" />
  <Heading as="h3" variant="heading-strong-s" align="center">
    No projects yet
  </Heading>
  <Text variant="body-default-s" onBackground="neutral-weak" align="center">
    Create your first project to start tracking work.
  </Text>
  <Button arrowIcon>Create project</Button>
</Column>
Center the block inside its parent with center on Column. Use maxWidth="xs" so text lines stay readable.

Inside a table or list panel

When a table has no rows, replace the Table with an empty state inside the same surface panel:
<Column background="surface" border="neutral-alpha-weak" radius="l" padding="24" gap="24">
  <Row fillWidth horizontal="between" vertical="center">
    <Heading as="h2" variant="heading-strong-m">Projects</Heading>
    <Button size="s" prefixIcon="plus">New</Button>
  </Row>
  {/* if rows.length === 0 → empty state Column */}
  {/* else → Table */}
</Column>
Keep the panel header (title + action button) visible even when empty. Only the body swaps to the empty state.

Error state anatomy

Error states add a retry path and use danger-adjacent colors sparingly:
<Column fillWidth center padding="48" gap="16" maxWidth="xs">
  <Icon name="alertCircle" size="l" onBackground="danger-medium" />
  <Heading as="h3" variant="heading-strong-s" align="center">
    Couldn't load projects
  </Heading>
  <Text variant="body-default-s" onBackground="neutral-weak" align="center">
    Check your connection and try again.
  </Text>
  <Row gap="12">
    <Button onClick={retry}>Try again</Button>
    <Button variant="secondary">Contact support</Button>
  </Row>
</Column>
Use onBackground="danger-medium" on the Icon only — not on the entire panel. Reserve danger borders for destructive actions (see settings danger zones).

Inline error vs full-page error

Scope
When
Layout
InlineSingle widget failed (chart, sidebar widget)Compact Column inside the widget's bounds
SectionMain content area failedCentered empty state in content Column
Full pageRoute-level failureColumn with `minHeight` filling the viewport
For inline errors, skip the Icon and use Text with a retry Button:

Filtered empty vs truly empty

Distinguish "no data exists" from "no matches for your filters":
Situation
Heading
Action
No data yet"No projects yet"Create / import Button
Filters returned zero"No matching projects"Clear filters Button (secondary)
Search returned zero"No results for '{query}'"Adjust search Text, no Button needed

Toast vs inline error

Use inline/section error states for persistent failures the user needs to act on. Use toast feedback for transient action failures (save failed, copy failed) where the form context is still visible.
Failure type
Surface
Page/section fetch failedInline or section error state
Form submit rejectedToast + keep form visible with field errors
Background sync failedToast notification

Agent checklist

When generating list or dashboard views:
  • Handle three render branches: loading → empty/error → data
  • Never show skeleton and empty state simultaneously
  • Include a primary action in empty states when the user can create data
  • Include retry in error states when the operation can be re-attempted
  • Differentiate filtered-empty from truly-empty copy

Write this / not this

✅ Once UI way
❌ Common mistake
Icon + Heading + Text + Button stackPlain "No data" string centered in a div
Empty state inside existing panelRemove panel chrome when empty
Retry Button on errorsError with no recovery path
"Clear filters" for filtered emptySame copy as truly-empty state
Toast for transient action failuresFull-page error for a failed save

Check yourself

  • Loading skeleton removed before showing empty/error
  • Empty state has heading, explanation, and action when applicable
  • Error state has retry or support path
  • Filtered-empty uses different copy than truly-empty
  • Danger colors limited to Icon accent, not full panel background

Related

→ Loading states → Tables & lists → Toast & feedback → Data filters & toolbar
<Column center padding="24" gap="8">
  <Text variant="body-default-s" onBackground="neutral-weak" align="center">
    Failed to load chart data.
  </Text>
  <Button size="s" variant="secondary">Retry</Button>
</Column>
<Column center gap="16" padding="48">
  <Heading as="h3" variant="heading-strong-s">No matching projects</Heading>
  <Text variant="body-default-s" onBackground="neutral-weak">
    Try adjusting your filters or search terms.
  </Text>
  <Button variant="secondary" onClick={clearFilters}>Clear filters</Button>
</Column>