npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@molecule/app-empty-state-react

v1.0.2

Published

React empty-state and CTA-card primitives

Readme

@molecule/app-empty-state-react

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

React empty-state and CTA-card primitives.

Exports:

  • <EmptyState> — centred icon + title + description + action for lists, feeds, boards, or tables that have no rows to render yet.
  • <CtaCard> — horizontal or vertical promotional card for "next-step" actions inside a page body.

Both components accept a className prop so apps can layer per-brand accent chrome (dashed borders, gradient CTAs, tinted backgrounds) on top of the structural layout.

Quick Start

import { EmptyState, CtaCard } from '@molecule/app-empty-state-react'
import { Button, Icon } from '@molecule/app-ui-react'

// Centred empty-state for a list with no items
<EmptyState
  icon={<Icon name="mail" size={40} />}
  title={t('messages.empty.title', {}, { defaultValue: 'No messages yet' })}
  description={t('messages.empty.description', {}, { defaultValue: 'When you receive messages they will appear here.' })}
  action={<Button onClick={() => openCompose()}>Send one</Button>}
/>

// Inline promotional card
<CtaCard
  title="Connect your bank"
  description="Link an account to start tracking transactions."
  action={<Button variant="solid">Connect</Button>}
/>

Type

feature

Installation

npm install @molecule/app-empty-state-react @molecule/app-react @molecule/app-ui @molecule/app-ui-react react
npm install -D @types/react

API

Interfaces

CtaCardProps

Props for {@link CtaCard}.

interface CtaCardProps {
  /** Optional small eyebrow line above the title. */
  eyebrow?: ReactNode
  /** Primary heading. */
  title: ReactNode
  /** Supporting copy. */
  description?: ReactNode
  /** Primary call-to-action. */
  action?: ReactNode
  /** Optional visual / illustration rendered at the top or side. */
  media?: ReactNode
  /** `'horizontal'` renders media beside text; `'vertical'` stacks them. Defaults to `'vertical'`. */
  layout?: 'vertical' | 'horizontal'
  /** `data-mol-id` for AI-agent selectors. */
  dataMolId?: string
  /** Override outer wrapper classes. */
  className?: string
}

EmptyStateProps

Props for {@link EmptyState}.

interface EmptyStateProps {
  /** Visual — typically an `<Icon>` or `<img>`. Rendered in a circular badge above the heading. */
  icon?: ReactNode
  /** Primary heading text (usually `t('...')`). */
  title: ReactNode
  /** Supporting description shown below the heading. */
  description?: ReactNode
  /** Action area — typically a `<Button>` or `<Link>`. */
  action?: ReactNode
  /** `data-mol-id` for AI-agent selectors. */
  dataMolId?: string
  /** Override outer wrapper classes (for per-app dashed-border, background, padding, etc.). */
  className?: string
  /** Override the icon-badge wrapper classes. */
  iconWrapperClassName?: string
}

Functions

CtaCard(props)

A "soft sell" card used to promote a next-step action inside a page body (e.g., "Connect your bank", "Invite teammates").

Differs from <EmptyState> in being positioned in a list of cards rather than filling the void. Supports a horizontal layout with the media slot beside the text.

function CtaCard({
  eyebrow,
  title,
  description,
  action,
  media,
  layout = 'vertical',
  dataMolId,
  className,
}: CtaCardProps): JSX.Element
  • props — Component props (see {@link CtaCardProps}).

EmptyState(props)

Generic centred empty-state panel for lists, feeds, boards, and tables.

Renders a vertical stack of [icon, title, description, action]. Typography and spacing come from the wired ClassMap; per-app accent chrome (dashed borders, tinted backgrounds, gradient CTAs) is passed via className on the outer element.

function EmptyState({
  icon,
  title,
  description,
  action,
  dataMolId,
  className,
  iconWrapperClassName,
}: EmptyStateProps): JSX.Element
  • props — Component props (see {@link EmptyStateProps}).

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-react ^1.0.1
  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-react ^1.0.1
  • react ^18.0.0 || ^19.0.0

Runtime Dependencies

  • @molecule/app-react

  • @molecule/app-ui

  • @molecule/app-ui-react

  • react

  • Name collision: @molecule/app-ui-react also exports an EmptyState (the ClassMap-token variant driven by cm.emptyState*). Use THAT one for plain framework-styled empty states; use THIS package when you want the circular icon badge (iconWrapperClassName), per-brand chrome via className, a dataMolId, or the companion <CtaCard>. If you import both packages, alias one import to avoid the clash.

  • All text arrives via props — translate with your t() calls; this package has no locale bond of its own.

  • Styling resolves through getClassMap() — requires a wired ClassMap bond (standard molecule app setup).