Onboarding empty states
Five first-run placeholders that turn an empty screen into a starting point: numbered setup steps, a completion checklist, a welcome panel with two actions, a product tour invitation and a list of tips. Each is sized, token-driven and renders with default copy.
Installation
The styled layer is free and installs like any other ai2 component.
Run the following command
npx shadcn@latest add @ai2/empty-onboardingDependencies, the @ai2/tokens theme and the component file are installed together.
Install dependencies
npm install lucide-reactCopy the source
components/ui/empty-onboarding.tsx"use client"
import * as React from "react"
import {
ArrowRight,
Check,
Compass,
Lightbulb,
PartyPopper,
Rocket,
} from "lucide-react"
import { cn } from "@/lib/utils"
/* Onboarding empty family: 5 first-run and getting-started empty states. Numbered steps, a checkable checklist, a welcome, a product tour and a tip list. Colour comes ONLY from semantic tokens (transparency via color-mix), size = the padding plus icon and text scale. Renders without props too. Static - no motion. */
export type StyledSize = "sm" | "md" | "lg" | "xl"
type Scale = {
root: string
icon: string
badge: string
title: string
description: string
}
const scales: Record<StyledSize, Scale> = {
sm: {
root: "gap-2 p-6",
icon: "size-6",
badge: "size-12",
title: "text-sm",
description: "text-xs",
},
md: {
root: "gap-3 p-8",
icon: "size-8",
badge: "size-16",
title: "text-base",
description: "text-sm",
},
lg: {
root: "gap-3.5 p-10",
icon: "size-10",
badge: "size-20",
title: "text-lg",
description: "text-sm",
},
xl: {
root: "gap-4 p-12",
icon: "size-12",
badge: "size-24",
title: "text-xl",
description: "text-base",
},
}
interface EmptyProps {
className?: string
size?: StyledSize
icon?: React.ReactNode
title?: React.ReactNode
description?: React.ReactNode
action?: React.ReactNode
}
const rootBase = "flex flex-col items-center justify-center text-center"
const iconBase = "[&_i]:leading-none [&_svg]:size-full"
const primaryBtn =
"inline-flex h-9 items-center justify-center gap-2 rounded-md bg-primary px-4 text-sm font-medium text-primary-foreground outline-none transition-colors duration-(--motion-base) ease-(--motion-ease) hover:bg-primary/90 focus-visible:ring-[3px] focus-visible:ring-ring/50 motion-reduce:transition-none [&_i]:text-base [&_i]:leading-none [&_svg]:size-4 [&_svg]:shrink-0"
const ghostBtn =
"inline-flex h-9 items-center justify-center gap-2 rounded-md border border-border bg-transparent px-4 text-sm font-medium text-foreground outline-none transition-colors duration-(--motion-base) ease-(--motion-ease) hover:bg-[color-mix(in_oklab,var(--color-foreground)_6%,transparent)] focus-visible:ring-[3px] focus-visible:ring-ring/50 motion-reduce:transition-none [&_i]:text-base [&_i]:leading-none [&_svg]:size-4 [&_svg]:shrink-0"
/* A soft primary-toned badge: primary has no -soft token, so it is derived with color-mix. */
const primaryBadge =
"flex items-center justify-center rounded-full border text-primary [background:color-mix(in_oklab,var(--color-primary)_12%,transparent)] [border-color:color-mix(in_oklab,var(--color-primary)_28%,transparent)]"
/* StepsEmpty: numarali baslangic adimlari + birincil aksiyon. */
export function StepsEmpty({
className,
size = "md",
icon,
title = "Set up your workspace",
description = "Three quick steps and your workspace is ready to use.",
action,
}: EmptyProps) {
const s = scales[size]
const steps = ["Name your workspace", "Invite your teammates", "Create your first project"]
return (
<div data-slot="styled-empty" className={cn(rootBase, s.root, className)}>
<span aria-hidden="true" className={cn(primaryBadge, s.badge)}>
<span className={cn(iconBase, s.icon)}>{icon ?? <Rocket />}</span>
</span>
<p className={cn("font-semibold text-foreground", s.title)}>{title}</p>
{description ? (
<p className={cn("max-w-prose text-muted-foreground", s.description)}>
{description}
</p>
) : null}
<ol className="mt-1 flex flex-col gap-2 text-left">
{steps.map((step, i) => (
<li key={step} className="flex items-center gap-2.5 text-sm">
<span className="flex size-6 shrink-0 items-center justify-center rounded-full border text-xs font-semibold text-primary [background:color-mix(in_oklab,var(--color-primary)_12%,transparent)] [border-color:color-mix(in_oklab,var(--color-primary)_28%,transparent)]">
{i + 1}
</span>
<span className="text-muted-foreground">{step}</span>
</li>
))}
</ol>
<div className="mt-2">
{action ?? (
<button type="button" data-slot="styled-empty-action" className={primaryBtn}>
Get started
<ArrowRight />
</button>
)}
</div>
</div>
)
}
/* ChecklistEmpty: tamamlanma durumu tasiyan kontrol listesi + ilerleme sayaci. */
export function ChecklistEmpty({
className,
size = "md",
icon,
title = "Finish setting up",
description = "You are almost there. Complete the remaining items to go live.",
action,
}: EmptyProps) {
const s = scales[size]
const items: { label: string; done: boolean }[] = [
{ label: "Verify your email", done: true },
{ label: "Connect a repository", done: true },
{ label: "Deploy your first build", done: false },
]
const done = items.filter((i) => i.done).length
return (
<div data-slot="styled-empty" className={cn(rootBase, s.root, className)}>
<span aria-hidden="true" className={cn(primaryBadge, s.badge)}>
<span className={cn(iconBase, s.icon)}>{icon ?? <Check />}</span>
</span>
<p className={cn("font-semibold text-foreground", s.title)}>{title}</p>
{description ? (
<p className={cn("max-w-prose text-muted-foreground", s.description)}>
{description}
</p>
) : null}
<p className="text-xs font-medium text-muted-foreground">
{done} of {items.length} complete
</p>
<ul className="mt-1 flex flex-col gap-2 text-left">
{items.map((item) => (
<li key={item.label} className="flex items-center gap-2.5 text-sm">
<span
aria-hidden="true"
className={cn(
"flex size-5 shrink-0 items-center justify-center rounded-full border [&_i]:text-xs [&_i]:leading-none [&_svg]:size-3",
item.done
? "bg-success-soft text-success-soft-foreground [border-color:color-mix(in_oklab,var(--color-success)_30%,transparent)]"
: "border-dashed border-border"
)}
>
{item.done ? <Check /> : null}
</span>
<span
className={cn(
item.done ? "text-muted-foreground line-through" : "text-foreground"
)}
>
{item.label}
</span>
</li>
))}
</ul>
{action ? <div className="mt-2">{action}</div> : null}
</div>
)
}
/* WelcomeEmpty: sicak karsilama, iki aksiyon (birincil + ikincil). */
export function WelcomeEmpty({
className,
size = "md",
icon,
title = "Welcome aboard",
description = "This is your dashboard. Create something and it will show up right here.",
action,
}: EmptyProps) {
const s = scales[size]
return (
<div data-slot="styled-empty" className={cn(rootBase, s.root, className)}>
<span aria-hidden="true" className={cn(primaryBadge, s.badge)}>
<span className={cn(iconBase, s.icon)}>{icon ?? <PartyPopper />}</span>
</span>
<p className={cn("font-semibold text-foreground", s.title)}>{title}</p>
{description ? (
<p className={cn("max-w-prose text-muted-foreground", s.description)}>
{description}
</p>
) : null}
<div className="mt-2 flex flex-wrap items-center justify-center gap-2">
{action ?? (
<>
<button type="button" data-slot="styled-empty-action" className={primaryBtn}>
Create your first item
</button>
<button type="button" className={ghostBtn}>
Read the guide
</button>
</>
)}
</div>
</div>
)
}
/* TourEmpty: urun turu daveti, adim noktalari + tur baslatma aksiyonu. */
export function TourEmpty({
className,
size = "md",
icon,
title = "Take the quick tour",
description = "A two minute walkthrough of the places you will use most.",
action,
}: EmptyProps) {
const s = scales[size]
const stops = ["Navigation", "Editor", "Sharing", "Settings"]
return (
<div data-slot="styled-empty" className={cn(rootBase, s.root, className)}>
<span aria-hidden="true" className={cn(primaryBadge, s.badge)}>
<span className={cn(iconBase, s.icon)}>{icon ?? <Compass />}</span>
</span>
<p className={cn("font-semibold text-foreground", s.title)}>{title}</p>
{description ? (
<p className={cn("max-w-prose text-muted-foreground", s.description)}>
{description}
</p>
) : null}
<div className="mt-1 flex flex-wrap items-center justify-center gap-x-2 gap-y-1.5">
{stops.map((stop, i) => (
<React.Fragment key={stop}>
{i > 0 ? (
<span
aria-hidden="true"
className="text-muted-foreground [&_i]:text-xs [&_i]:leading-none [&_svg]:size-3"
>
<ArrowRight />
</span>
) : null}
<span className="rounded-full border border-border px-2.5 py-0.5 text-xs text-muted-foreground">
{stop}
</span>
</React.Fragment>
))}
</div>
<div className="mt-2">
{action ?? (
<button type="button" data-slot="styled-empty-action" className={primaryBtn}>
<Compass />
Start the tour
</button>
)}
</div>
</div>
)
}
/* TipsEmpty: bos ekranda ise yarar ipuclari listesi. */
export function TipsEmpty({
className,
size = "md",
icon,
title = "Nothing here yet",
description = "While this is empty, here are a few things worth knowing.",
action,
}: EmptyProps) {
const s = scales[size]
const tips = [
"Press the plus button to add an item.",
"Drag items to reorder them at any time.",
"Everything you create is saved automatically.",
]
return (
<div data-slot="styled-empty" className={cn(rootBase, s.root, className)}>
<span aria-hidden="true" className={cn(primaryBadge, s.badge)}>
<span className={cn(iconBase, s.icon)}>{icon ?? <Lightbulb />}</span>
</span>
<p className={cn("font-semibold text-foreground", s.title)}>{title}</p>
{description ? (
<p className={cn("max-w-prose text-muted-foreground", s.description)}>
{description}
</p>
) : null}
<ul className="mt-1 flex max-w-prose flex-col gap-2 text-left">
{tips.map((tip) => (
<li key={tip} className="flex items-start gap-2.5 text-sm text-muted-foreground">
<span
aria-hidden="true"
className="mt-0.5 shrink-0 text-primary [&_i]:text-xs [&_i]:leading-none [&_svg]:size-4"
>
<Lightbulb />
</span>
{tip}
</li>
))}
</ul>
{action ? <div className="mt-2">{action}</div> : null}
</div>
)
}Manual installs skip the @ai2/tokens theme, so add the token CSS from the theming guide or the tone colors will be missing.
Variations
5 takes on the same idea. Each is its own export, and every one accepts a size prop (sm, md, lg, xl) aligned to the base Button scale.
Steps
Numbered setup steps above a primary action.
Set up your workspace
Three quick steps and your workspace is ready to use.
- 1Name your workspace
- 2Invite your teammates
- 3Create your first project
import { StepsEmpty } from "@/components/ui/empty-onboarding"
<StepsEmpty />Set up your workspace
Three quick steps and your workspace is ready to use.
- 1Name your workspace
- 2Invite your teammates
- 3Create your first project
Set up your workspace
Three quick steps and your workspace is ready to use.
- 1Name your workspace
- 2Invite your teammates
- 3Create your first project
Set up your workspace
Three quick steps and your workspace is ready to use.
- 1Name your workspace
- 2Invite your teammates
- 3Create your first project
Set up your workspace
Three quick steps and your workspace is ready to use.
- 1Name your workspace
- 2Invite your teammates
- 3Create your first project
Checklist
A checklist with a completion counter and ticked items.
Finish setting up
You are almost there. Complete the remaining items to go live.
2 of 3 complete
- Verify your email
- Connect a repository
- Deploy your first build
import { ChecklistEmpty } from "@/components/ui/empty-onboarding"
<ChecklistEmpty />Finish setting up
You are almost there. Complete the remaining items to go live.
2 of 3 complete
- Verify your email
- Connect a repository
- Deploy your first build
Finish setting up
You are almost there. Complete the remaining items to go live.
2 of 3 complete
- Verify your email
- Connect a repository
- Deploy your first build
Finish setting up
You are almost there. Complete the remaining items to go live.
2 of 3 complete
- Verify your email
- Connect a repository
- Deploy your first build
Finish setting up
You are almost there. Complete the remaining items to go live.
2 of 3 complete
- Verify your email
- Connect a repository
- Deploy your first build
Welcome
A warm welcome with a primary and a secondary action.
Welcome aboard
This is your dashboard. Create something and it will show up right here.
import { WelcomeEmpty } from "@/components/ui/empty-onboarding"
<WelcomeEmpty />Welcome aboard
This is your dashboard. Create something and it will show up right here.
Welcome aboard
This is your dashboard. Create something and it will show up right here.
Welcome aboard
This is your dashboard. Create something and it will show up right here.
Welcome aboard
This is your dashboard. Create something and it will show up right here.
Tour
The tour stops are chained above a start-the-tour action.
Take the quick tour
A two minute walkthrough of the places you will use most.
import { TourEmpty } from "@/components/ui/empty-onboarding"
<TourEmpty />Take the quick tour
A two minute walkthrough of the places you will use most.
Take the quick tour
A two minute walkthrough of the places you will use most.
Take the quick tour
A two minute walkthrough of the places you will use most.
Take the quick tour
A two minute walkthrough of the places you will use most.
Tips
A short list of tips fills the empty screen.
Nothing here yet
While this is empty, here are a few things worth knowing.
- Press the plus button to add an item.
- Drag items to reorder them at any time.
- Everything you create is saved automatically.
import { TipsEmpty } from "@/components/ui/empty-onboarding"
<TipsEmpty />Nothing here yet
While this is empty, here are a few things worth knowing.
- Press the plus button to add an item.
- Drag items to reorder them at any time.
- Everything you create is saved automatically.
Nothing here yet
While this is empty, here are a few things worth knowing.
- Press the plus button to add an item.
- Drag items to reorder them at any time.
- Everything you create is saved automatically.
Nothing here yet
While this is empty, here are a few things worth knowing.
- Press the plus button to add an item.
- Drag items to reorder them at any time.
- Everything you create is saved automatically.
Nothing here yet
While this is empty, here are a few things worth knowing.
- Press the plus button to add an item.
- Drag items to reorder them at any time.
- Everything you create is saved automatically.
ai2 Onboarding empty states: 5 styled variations on the token system
The ai2 Onboarding empty states are a set of 5 decorative button variations from the styled layer of the @ai2 design system, built around first-run and get-started empty states. They are free and MIT licensed, and every color comes from a semantic token, so they theme with the rest of ai2 in light and dark.
Motion runs on framer-motion: these are static; no motion library work is required. The styled layer is opt-in, so the dependency only lands if you use it; the base components stay lean. Under reduced motion, there is no motion to reduce.
What is in the ai2 Onboarding empty states?
5 exports in one file: Steps, Checklist, Welcome, Tour and Tips. Each renders a native button and takes a size prop (sm, md, lg, xl) aligned to the base Button. They are separate from the base Button on purpose: the base keeps its clean variant, tone and size axes, while the styled layer carries the effects.
You own the file. Copy the one category file and you have all 5 variations, with no runtime dependency on ai2 itself.
Why use it
- On-system by construction: Every color resolves to an ai2 semantic token, so the buttons follow your theme in light and dark with no extra work.
- Effect without the sprawl: The decorations live in a dedicated styled file, so the base Button keeps its clean, predictable API.
- Accessible and honest: Each renders a real button element, keeps a visible focus ring, and respects prefers-reduced-motion.
Features
- Token-driven color: No hardcoded hex or oklch; the look recolors with your theme tokens.
- framer-motion: these are static; no motion library work is required.
- Reduced-motion aware: Under prefers-reduced-motion, there is no motion to reduce.
- Size aligned to the base: Every variation takes sm, md, lg and xl matching the base Button height scale, so styled and base buttons line up in a row.
Production tips
- Use it for emphasis, not everywhere: Styled buttons draw the eye. Reserve them for the one action you want people to take on a screen, and use the base Button for the rest.
- Keep labels as verbs: The decoration adds weight, so a clear action label keeps the button scannable.
- Pick one variation per surface: The variations share a family; using two different ones in the same view competes for attention.
Works with the rest of ai2
The Onboarding empty states sit alongside the base Button and the rest of the @ai2 registry. They share the same token file, so a styled action next to a base button or a badge stays visually consistent in both modes.