Skip to content

Empty State

Get Ritla UI

Fills a region that has no content yet, says why, and points to the next step.

Ritla scan of this preview: 41 of 41 checks3 breakpointsScanned

Open in Figma

Preview

Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.

PreviewCode
EnglishMirroredArabic
LTR →

Installation

  1. Add the component

    npx ritla add empty

    Also works with shadcn: npx shadcn@latest add @ritla/empty

  2. Or copy by hand

    Installing by hand copies the component's source into your project. The source comes with a Ritla UI license, so the CLI is the short way to the same files.

Usage

empty.tsx
import { Empty } from "@/components/ui/empty";<Empty  illustration="no-transactions"  title="No transactions yet"  description="When you send or receive money, it will show up here."  primary={{ label: "Add money", href: "/add-money" }}/>

Examples

Couldn't load

Say what went wrong in plain words and offer Try again.

EnglishMirroredArabic
LTR →

Compact, in a card

size="compact" for small regions: no illustration, a smaller title, the action.

EnglishMirroredArabic
LTR →

Stacked actions

stacking="vertical" for long labels, primary on top.

EnglishMirroredArabic
LTR →

Illustrations

Figma's Empty state illustrations in token colors, so they follow dark mode and the brand mode. Pick the one that matches the content with subject; never recolor or crop one. They are drawn for Arabic, so they show as drawn there and mirror in English, the tick kept upright. 160 by default; <EmptyIllustration size={240} /> for large regions.

EnglishMirroredArabic
LTR →

API reference

Empty

PropTypeDefaultDescription
illustrationEmptyIllustrationSubject | ReactNodeNoneFigma's Empty state illustration slot: a subject (drawn at 160) or any node.
titleReactNodeNoneFigma's Title: what's missing; a heading.
descriptionReactNodeNoneFigma's Description: what will appear here, or how to fill it.
headingLevel2 | 3 | 4 | 5 | 63The title's heading level.
primary / secondary{ label; href?; render?; onClick? }NoneThe primary (Filled) and secondary (Tonal) actions.
stacking"horizontal" | "vertical""horizontal"Figma's Stacking.
size"default" | "compact""default"compact for cards and small regions.
announce"status"NoneFor no-results messages after a search or filter.

EmptyIllustration

PropTypeDefaultDescription
subjectEmptyIllustrationSubjectNoneFigma's Subject: what is missing ("no-transactions"). Always decorative.
size160 | 240160Figma's Size.
mirrorbooleantrueFlips the drawing in left-to-right pages, since it is drawn for Arabic.

Accessibility

Keyboard

Keys are written for left-to-right. In right-to-left the arrow keys swap: the one pointing toward the reading direction moves forward.

KeyAction
TabTo the primary action, then the secondary.

ARIA

  • The title is a real heading (h3 by default) so screen readers can find it.
  • Illustrations are decorative and hidden from screen readers; the explanation is never only in the picture.
  • No-results messages are announced with status; focus stays where it was and never jumps to them.

Arabic and RTL notes

Mirrors

  • The text stays centered and the primary action comes first: on the right.
  • The illustration is drawn for Arabic (Figma: "RTL by default"): the hard shadow to the left, the disc at the end. In English the whole drawing mirrors.

Does not mirror

  • A tick inside an illustration stays upright when the drawing mirrors.
Numerals
Numbers in the description follow the numerals setting; format them with formatNumber.
Arabic typography
Title body-20 Medium (body-16 when compact), description body-14.
Mixed-direction text
What the person searched for goes in <bdi>, since it can be in either language.

Checks it passes

The Ritla checks this component satisfies by construction. Used as documented, it does not bring these defects onto your page.

  • R022text-align: left explicitly set on majority-Arabic text
  • R042Clipped text: content wider than its box with overflow hidden and no ellipsis
  • R043Fixed-pixel-width container whose Arabic text exceeds the space
  • R050Arabic text falling back past the declared font family (measured, declared, or a webfont that failed to load)
  • R051letter-spacing applied to Arabic text (breaks the connected script)