Keyframery

Empty

Empty states arrive part by part: the icon tile pops and its strokes draw, then the title, the description and each action rise in out of a blur.

See it as an AI agent does.

Resize preview. Focus the handle and use the left or right arrow keys. Hold Shift for larger steps.— px
Customize1 controls
Animation speed1×

Installation

npx shadcn@latest add @keyframery/empty

This adds components/keyframery/empty.tsx and its primitive to your project, and installs UI SDK, along with agent-content, which it builds on. The motion tokens are added to your global CSS the first time you install a component.

Usage

import { Inbox } from "lucide-react"

import { Empty, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "@/components/keyframery/empty"

export default function Usage() {
  return (
    <Empty>
      <EmptyHeader>
        <EmptyMedia variant="icon">
          <Inbox />
        </EmptyMedia>
        <EmptyTitle>No messages</EmptyTitle>
        <EmptyDescription>New messages will show up here.</EmptyDescription>
      </EmptyHeader>
    </Empty>
  )
}

Anatomy

How the parts fit together:

Empty
└── EmptyHeader
    ├── EmptyMedia
    ├── EmptyTitle
    └── EmptyDescription

Examples

Basic

The parts arrive in turn: the icon tile pops and its strokes draw, then the title, the description and each action rise in.

announce reads the title and description to screen readers when the empty state appears, so a search that finds nothing is heard, not only seen.

With pictures

The default EmptyMedia holds anything, like a small stack of photos; each one pops in after the last.

Motion

MoveWhat you see
DrawThe media pops in from 0.6 and the strokes of the icon inside it draw themselves.
CascadeThe title, the description and then each action rise 10px out of a blur, one after another.

Timing and springiness follow the motion style you set. To change how fast this empty moves, pass speed:

<Empty speed="fast">
  …
</Empty>

"fast" is 0.6×, "slow" 1.4×, and a number sets the multiplier. With reduced motion turned on, nothing moves: changes happen at once or with a short fade.

Theming

Set these CSS variables on the component or a parent. Leave them unset to follow the light and dark theme. The open Customize panel below the preview lets you try these settings.

VariableWhat it changesDefault
--empty-faceIcon surfacebg-background
--empty-inkIcon and linkstext-foreground
--empty-mutedDescription colourtext-muted-foreground
--empty-radiusIcon cornersrounded-[13px]
--empty-fontTitle sizetext-[15px]
--empty-gapSection gapgap-5
--empty-paddingEmpty-state paddingp-8
--empty-media-sizeIcon tile sizesize-12

API reference

Every part takes className and children, along with the props of the element it renders. The parts are rendered by UI SDK, so they also take render, to draw your own element, and a function of their state for className and style.

Empty

Renders a <div>, and takes its props too.

Prop

Type

EmptyMedia

Renders a <div>, and takes its props too.

Prop

Type

Other parts

These take the props of the element they render, and nothing else:

  • EmptyHeader: a <div>
  • EmptyTitle: a <div>
  • EmptyDescription: a <p>
  • EmptyContent: a <div>

Accessibility

Roles, keyboard and focus are declared on the component's UI SDK primitive, and state is announced through the matching ARIA attributes. More in Accessibility.

Built on UI SDK's core

UI SDK doesn't ship a empty, so this one is defined with its core: one definePrimitive in components/keyframery/core/empty-core.ts, with no React in it. UI SDK's adapters can render that same definition in Vue, Svelte, Solid and web components. To keep your own styling and take only the motion, import from @/components/keyframery/primitives/empty.

Questions

How does the animated Empty for UI SDK move?

Draw: The media pops in from 0.6 and the strokes of the icon inside it draw themselves. Cascade: The title, the description and then each action rise 10px out of a blur, one after another.

Do I need Motion or Framer Motion for the animated Empty?

No. Every move is plain CSS, so there is nothing to install besides the component and UI SDK.

UI SDK has no empty. How is this one built on UI SDK?

Its behaviour is one definition written with UI SDK's core (definePrimitive), in components/keyframery/core/empty-core.ts. Its parts are rendered by UI SDK's adapter, so they take render, state-based class names and data-slot, like every UI SDK component.

What happens to the Empty when someone turns on reduced motion?

Nothing moves. State changes happen at once, or with a short fade.

All components

On this page