Not Found

What a list, a grid or a page shows when it has nothing to show: one quiet box with its line.

No items found
import { NotFound } from "@produkto/ui/NotFound";

const Example = () => <NotFound>No items found</NotFound>;

export default Example;

Usage

import { NotFound } from "@produkto/ui/NotFound";
<NotFound>No items found</NotFound>

Examples

Appearances

appearance paints the box on the kit's one scale: solid, the default, on the input's fill, soft on the grey wash, outline with only its line, and transparent with neither, its words alone, as a table or a board with nothing in it says so.

Solid
Soft
Outline
Transparent
import { NotFound, type NotFoundAppearance } from "@produkto/ui/NotFound";

const appearances: { appearance: NotFoundAppearance; label: string }[] = [
  { appearance: "solid", label: "Solid" },
  { appearance: "soft", label: "Soft" },
  { appearance: "outline", label: "Outline" },
  { appearance: "transparent", label: "Transparent" },
];

const Example = () => (
  <div className="flex w-full max-w-sm flex-col gap-4">
    {appearances.map((item) => (
      <NotFound key={item.appearance} appearance={item.appearance}>
        {item.label}
      </NotFound>
    ))}
  </div>
);

export default Example;

Sizes

size sets the box's height, inset and words: sm 80px high around 12px words, base 96px around 14px words (the default), or lg 128px around 16px words.

Small
Base
Large
import { NotFound, type NotFoundSize } from "@produkto/ui/NotFound";

const sizes: { size: NotFoundSize; label: string }[] = [
  { size: "sm", label: "Small" },
  { size: "base", label: "Base" },
  { size: "lg", label: "Large" },
];

const Example = () => (
  <div className="flex w-full max-w-sm flex-col gap-4">
    {sizes.map((item) => (
      <NotFound key={item.size} size={item.size}>
        {item.label}
      </NotFound>
    ))}
  </div>
);

export default Example;

Border radius

borderRadius sets the box's corners on the kit's one scale: none, xs 4px, sm 6px, base 8px, lg 12px (the default) or xl 16px.

none
xs
sm
base
lg
xl
import {
  NotFound,
  type NotFoundBorderRadius,
} from "@produkto/ui/NotFound";

const radii: NotFoundBorderRadius[] = ["none", "xs", "sm", "base", "lg", "xl"];

const Example = () => (
  <div className="flex w-full max-w-sm flex-col gap-4">
    {radii.map((borderRadius) => (
      <NotFound key={borderRadius} borderRadius={borderRadius}>
        {borderRadius}
      </NotFound>
    ))}
  </div>
);

export default Example;

Title

title sets a heading over the words, what is missing above what to do about it, as every empty page in the app says it; none by default.

Title

Description

Title

Description
import { Button } from "@produkto/ui/Button";
import { NotFound } from "@produkto/ui/NotFound";

const Example = () => (
  <div className="flex w-full max-w-sm flex-col gap-4">
    <NotFound title="Title">Description</NotFound>
    <NotFound action={<Button size="sm">Button</Button>} title="Title">
      Description
    </NotFound>
  </div>
);

export default Example;

Action

action sets a button under the words, for the one thing to do next, such as adding the first item; none by default.

No items found
No items found
import { Button } from "@produkto/ui/Button";
import { NotFound } from "@produkto/ui/NotFound";

const Example = () => (
  <div className="flex w-full max-w-sm flex-col gap-4">
    <NotFound>No items found</NotFound>
    <NotFound action={<Button size="sm">Button</Button>}>
      No items found
    </NotFound>
  </div>
);

export default Example;

API Reference

NotFound

NotFoundProps · components/NotFound/NotFound.types.ts
PropTypeDefault
appearanceNotFoundAppearance"solid" | "soft" | "outline" | "transparent""solid"
sizeNotFoundSize"sm" | "base" | "lg""base"
borderRadiusNotFoundBorderRadius"none" | "xs" | "sm" | "base" | "lg" | "xl""lg"
titleReactNode-
actionReactNode-

It also takes the props of <div>.