Atoms / Empty state

Empty state

What a list shows with nothing in it, and what to do about it.

import { EmptyState } from "@forgeron/ui";
/01 → Hatch

No form here yet.

Create one or start from a template.

import { NoteAddIcon } from "@forgeron/icons";
import { EmptyState } from "@forgeron/ui";

export default function Hatch() {
  return (
    <div style={{ width: "100%", maxWidth: 560 }}>
      <EmptyState
        variant="hatch"
        icon={NoteAddIcon}
        title="No form here yet."
        description={
          <>
            <a href="#new">Create one</a> or <a href="#templates">start from a template</a>.
          </>
        }
      />
    </div>
  );
}
/02 → With action

No project views yet.

Filter the projects list, then save it.

import { Button, EmptyState } from "@forgeron/ui";

export default function WithAction() {
  return (
    <div style={{ width: "100%", maxWidth: 560 }}>
      <EmptyState
        title="No project views yet."
        description="Filter the projects list, then save it."
        action={<Button variant="primary">New view</Button>}
      />
    </div>
  );
}
API → Props
PropTypeDefaultDescription
titleReactNode—One line.
descriptionReactNode—The way out, links allowed.
iconIconDefinition—Above the title.
variant"plain" | "hatch""plain"A dashed frame, or the hatched field.
actionReactNode—The one thing to do.
classNamestring—Extra classes.