Empty
Empty state whose icon is an unlit neon tube that flickers on once there's an action to take.
No deployments yet
Push to main and acme-web builds on its own, or ship the current branch from here.
Installation
npx shadcn@latest add https://neonkit.heyaadi.com/r/empty.jsonUsage
import { Empty, EmptyContent, EmptyDescription, EmptyMedia, EmptyTitle } from "@/components/ui/empty"
<Empty>
<EmptyMedia variant="tube">
<Rocket />
</EmptyMedia>
<EmptyTitle>No deployments yet</EmptyTitle>
<EmptyDescription>Push to main and it builds on its own.</EmptyDescription>
<EmptyContent>
<Button variant="solid">Deploy main</Button>
</EmptyContent>
</Empty>Examples
Lit by the action
As a viewer there's nothing to do and the tube stays dark. Switch to admin: the button appears and the tube ignites.
No results
The icon tile, for empty states that don't need light.
Aligned to the start
align="start" for panels and side columns, where a centred block floats.
API reference
Empty
The block. Renders a div and accepts every native div attribute.
| Prop | Type | Default |
|---|---|---|
align | "center"Centred, or flush left. | "center" |
size | "sm"Vertical padding: 32 or 56px. | "md" |
color | NeonColorColor of the lit tube. | inherited |
EmptyMedia
Holds an icon or illustration. Decorative, so it's hidden from screen readers.
| Prop | Type | Default |
|---|---|---|
variant | "default"Bare, an icon on a quiet tile, or the icon as a neon tube. | "default" |
lit | booleanTube only: force it on, or keep it dark, instead of following EmptyContent. | None |
EmptyTitle, EmptyDescription, EmptyContent
Text and actions. Each accepts native attributes.
| Prop | Type | Default |
|---|---|---|
EmptyTitle | h3An h3, to sit under a page or panel h2. | None |
EmptyDescription | pCapped at 42 characters a line, balanced. | None |
EmptyContent | divActions. An enabled button or link in here is what lights the tube. | None |
Accessibility
- The tube follows EmptyContent through CSS :has(), so an action that appears later still lights it, with no JavaScript.
- Hovering or focusing the action turns the tube's halo up.
- With reduced motion the tube switches on without the flicker.