Empty state

What a list shows before it has anything in it: a card with a dithered band in your accent colour, a small drawing of stacked cards, two lines of text and the one thing to do next.

No projects yet

Start your first one and it will show up here.

Import

Options

Screen
Colour

Code

import "./empty-state.css";

/* <EmptyState title="No projects yet" text="Start your first one…" action="New project" onAction={create} other="Import" otherHref="/import" /> */
export function EmptyState({ title, text, action, onAction, other, otherHref = "#" }) {
  return (
    <div className="dh-empty">
      <div className="dh-empty-top" aria-hidden="true" />
      <div className="dh-empty-art" aria-hidden="true">
        <span />
        <span />
        <span>
          <i />
          <b />
          <b />
        </span>
      </div>
      <p className="dh-empty-title">{title}</p>
      <p className="dh-empty-text">{text}</p>
      {(action || other) && (
        <div className="dh-empty-actions">
          {action && (
            <button className="dh-empty-action" type="button" onClick={onAction}>
              <svg viewBox="0 0 12 12" aria-hidden="true">
                <path d="M6 2.5v7M2.5 6h7" />
              </svg>
              {action}
            </button>
          )}
          {other && (
            <a className="dh-empty-other" href={otherHref}>
              {other}
            </a>
          )}
        </div>
      )}
    </div>
  );
}

export function Example() {
  return <EmptyState title="No projects yet" text="Start your first one and it will show up here." action="New project" other="Import" />;
}

No projects yet

Start your first one and it will show up here.

Import