Skip to content
NewService Map: 30 components for hosts, ports and routes
<PxEmpty />ReactActions & feedbackFree

Empty state

Empty state with one of four pixel illustrations that drop into place and float, plus a title, a line of help and room for actions.

View as Markdown
<PxEmpty />

Playground

Change a prop and the component re-renders. Props marked remounts set an initial value, so the component starts over.

Loading <PxEmpty />
Props
kindlive
headinglive
descriptionlive
React
<PxEmpty kind="search" />

Installation

pnpm dlx shadcn@latest add @lumesec/px-empty
First timeRegister the @lumesec registry once, or install by URL+

Adds @lumesec to your components.json:

pnpm dlx shadcn@latest registry add @lumesec=https://elements.lumesec.ai/r/{name}.json

Or skip the setup and install by URL:

npx shadcn@latest add https://elements.lumesec.ai/r/px-empty.json

Usage

px-empty-example.tsx
import { PxEmpty } from "@/components/lumesec/px-empty";

export function Example() {
  return (
    <PxEmpty kind="search">
      <button type="button">Clear search</button>
    </PxEmpty>
  );
}

Behaviour

Four pixel illustrations that drop into place and float gently, with a title, a line of help and a slot for actions.

API reference

Props

Also accepts every prop of <div> (React.ComponentProps<"div">), spread onto the root element.

kindType"inbox" | "search" | "error" | "done"Default"inbox"

Illustration and default copy. Changing it drops the new illustration in.

headingTypeReact.ReactNodeDefaultper kind

Title. Defaults to "No messages yet", "No results", "Something went wrong" or "All caught up".

descriptionTypeReact.ReactNodeDefaultper kind

Help line under the title. Defaults to a sentence for the kind.

childrenTypeReact.ReactNode

Actions, such as buttons, centred under the text.

Ref

ref points at the root HTMLDivElement.

Accessibility

  • The illustration canvas is aria-hidden.
  • The title is an <h3>; the heading level cannot be changed.
  • Reduced motion: the pixels appear in place without dropping, and the floating and sparkles are off.

Theming

Styled with Tailwind classes on your shadcn theme tokens, so light and dark follow your theme. The accent comes from --lumesec. See Theming.

This component reads --foreground, --muted-foreground, --lumesec, --lumesec-shine, --lumesec-warning and --lumesec-success.

Notes

  • error draws in the warning colour and done in the success colour; the other kinds use the accent.
  • Without reduced motion the illustration animates continuously while it is on screen.

Was this page helpful?