All blocks
[39] Feedback
Empty States
Three empty states, first run, no results and no access, each with an icon, a title, one line and an action.
1280px
Copy the code
One file with one component and its sample data. It needs @vaneui/ui and its stylesheet, set up as in the installation guide.
empty-states.tsx
import type { ReactNode } from "react";import { Button, Card, Col, Container, Grid3, Icon, Section, Text, Title } from "@vaneui/ui";
function Svg({ children }: { children: ReactNode }) { return ( <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"> {children} </svg> );}
/** One empty state: an icon, what is missing, why, and the one thing to do next */function EmptyState({ icon, title, text, children }: { icon: ReactNode; title: string; text: string; children: ReactNode }) { return ( <Card itemsCenter justifyCenter paddingY className="min-h-80"> <Col itemsCenter className="max-w-xs"> <Icon lg padding pill secondary filled>{icon}</Icon> <Col xs itemsCenter> <Title tag="h2" textCenter>{title}</Title> <Text secondary textCenter>{text}</Text> </Col> {children} </Col> </Card> );}
export function EmptyStates() { return ( <Section> <Container itemsStretch> <Grid3> <EmptyState title="No projects yet" text="Projects hold your tasks, docs and files. Create one to get started." icon={<Svg><rect x="3" y="4" width="7" height="16" rx="1" /><rect x="14" y="4" width="7" height="10" rx="1" /></Svg>}> <Button href="/projects/new" filled>Create a project</Button> </EmptyState> <EmptyState title="No results for “invoice”" text="Check the spelling, or clear the filters to search all projects." icon={<Svg><circle cx="11" cy="11" r="7" /><path d="m20 20-4-4M8 11h6" /></Svg>}> <Button type="button">Clear filters</Button> </EmptyState> <EmptyState title="You don’t have access" text="This project is private. Ask Ana Diaz, its owner, to add you." icon={<Svg><rect x="4" y="11" width="16" height="10" rx="2" /><path d="M8 11V7a4 4 0 0 1 8 0v4" /></Svg>}> <Button type="button">Request access</Button> </EmptyState> </Grid3> </Container> </Section> );}Adapt it with your coding agent
Add the VaneUI MCP server, and your agent reads the component docs and prop tables while it changes the block: the copy, the sample data or the layout.
$ claude mcp add vaneui -- npx -y @vaneui/mcp
Setup for other editors is in the AI assistants guide.