Ballmac UI home

State View

New

Shows the right thing for what the data is doing: a skeleton while loading, a helpful empty state, an error with retry, or your content. Announced to screen readers, never steals focus, fades with the theme's motion.

v1.0.1Updated Oct 12, 2026Ships with a testUpdate without losing your edits

What changed
  1. 1.0.1 Oct 12, 2026Moves frameProps into its own frame-props module so server components can use it; state-view still exports it.
  2. 1.0.0 Oct 12, 2026First release.

Recent activity

  • Maya Jensen approved the Q4 launch plan

    2m ago
  • Dev Patel commented on Pricing page

    18m ago
  • Sana Okafor shipped build 482 to production

    1h ago
  • Lucas Meyer invited 3 teammates

    3h ago

Installation

$ pnpm dlx shadcn@latest add @ballmac/state-view

Usage

import { StateView, frameProps } from "@/components/ballmac/state-view"

The full example is in the Code tab above.

Examples

With a real fetch

Invoices

Loading

API reference

<StateView>

PropTypeDefault
state*

What to show. `submitting` and `success` belong to forms and render the children.

BlockState—
loading

Shown while loading. Make it the same shape as the ready content so nothing jumps. A plain set of lines is used if you leave it out.

React.ReactNode—
empty

Copy and action for the empty state, or your own node.

EmptyConfig | React.ReactNode—
error

Copy for the error state, or your own node.

ErrorConfig | React.ReactNode—
onRetry

Called by the retry button. Without it the button is not drawn.

() => void—
label

Text announced to assistive technology while loading.

string—
bare

Drop the empty and error panels' border and tint, for use inside a frame that already has them.

booleanfalse
children

The ready content.

React.ReactNode—

<State>

PropTypeDefault
state

What the block shows. Defaults to `ready`.

BlockState—
onRetry

Called by the retry button in the error state. Without it the button is not drawn.

() => void—
emptyState

Copy and action for the empty state.

EmptyConfig—
errorState

Copy for the error state.

ErrorConfig—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Screen readerLoading is announced as a status; an error is announced as an alert; the region is aria-busy while loading
TabReaches the retry button and the details disclosure; focus is never moved for you

Use with AI

Wrap any data view: <StateView state={state} loading={<MySkeleton/>} empty={{ title, description, action }} error={{ title, description, details }} onRetry={retry}>{ready content}</StateView>. Pair with useResource, which returns the state. Loading is announced and the region is aria-busy; errors use role=alert; focus is never moved. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI State View (@ballmac/state-view) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Any list, table, feed or panel that loads data
  • Giving a block its loading, empty and error views without writing them each time

Not for

  • Forms: they track submitting and success themselves (blocks with a state prop handle it)
  • A single value that is just a number: use a skeleton line

Registry JSON: https://ui.ballmac.com/r/state-view.json

Credits

Free to use in personal and commercial projects.