import { Button, Empty } from "@replicas/ui";

export default function EmptyDemo() {
  return (
    <Empty.Root>
      <Empty.Icon>
        <svg viewBox="0 0 24 24" fill="none" aria-hidden>
          <rect x="4" y="5" width="16" height="14" rx="3" stroke="currentColor" strokeWidth="1.5" />
          <path d="M4 10h16" stroke="currentColor" strokeWidth="1.5" />
        </svg>
      </Empty.Icon>
      <Empty.Title>No files</Empty.Title>
      <Empty.Description>Files you upload will show up here.</Empty.Description>
      <Empty.Actions>
        <Button variant="primary">Upload file</Button>
      </Empty.Actions>
    </Empty.Root>
  );
}

Prompt

Copy Prompt hands your agent everything it needs to build the Empty in the Codex style: the measured tokens, the CSS and the structure.

Show Prompt
# Codex Empty

A placeholder for views that have nothing to show yet.

Build a Empty in this project that looks and behaves like Codex's. Measured from the running Codex app (openai.com/codex). Keep every value exact. Map the tokens onto the project's own theme variables instead of hard-coding them. Use the project's own component library for behaviour, or Base UI primitives if it has none.

Fidelity: Derived from the Codex app's Button and chip classes.

## Tokens

| Token | Light | Dark |
| --- | --- | --- |
| `--text-primary` | `rgb(26 28 31)` | `#ffffff` |
| `--text-tertiary` | `rgb(21 28 42 / 0.494)` | `rgb(255 255 255 / 0.498)` |
| `--icon-secondary` | `rgb(13 13 13 / 0.717)` | `rgb(255 255 255 / 0.71)` |
| `--button-secondary-bg` | `rgb(13 13 13 / 0.05)` | `rgb(255 255 255 / 0.05)` |
| `--font-size-small` | `13px` | `13px` |
| `--font-size-regular` | `14px` | `14px` |
| `--font-weight-normal` | `430` | `430` |
| `--font-weight-semibold` | `600` | `600` |
| `--corner-shape` | `round` | `round` |
| `--radius-lg` | `calc(10px * var(--radius-scale))` | `calc(10px * var(--radius-scale))` |

## CSS

Scoped under `[data-style="codex"]`; dark rules sit under `[data-theme="dark"]`. The `ui-*` classes and data attributes match the structure below.

```css
[data-style="codex"] {
  .ui-empty {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 360px;
    margin: 0 auto;
    padding: 32px 16px;
    font-family: inherit;
    text-align: center;
  }

  .ui-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    border-radius: var(--radius-lg);
    corner-shape: var(--corner-shape);
    background-color: var(--button-secondary-bg);
    color: var(--icon-secondary);

    & svg {
      width: 20px;
      height: 20px;
    }
  }

  .ui-empty-title {
    margin: 0;
    color: var(--text-primary);
    font-size: var(--font-size-regular);
    font-weight: var(--font-weight-semibold);
    line-height: 20px;
  }

  .ui-empty-description {
    margin: 4px 0 0;
    color: var(--text-tertiary);
    font-size: var(--font-size-small);
    font-weight: var(--font-weight-normal);
    line-height: 18px;
  }

  .ui-empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
  }
}
```

## Structure

How Replicas assembles it on Base UI.

```tsx
import type { ComponentProps } from "react";
import { join } from "./utils";

const part = (name: string) =>
  function Part({ className, ...props }: ComponentProps<"div">) {
    return <div className={join(name === "root" ? "ui-empty" : `ui-empty-${name}`, className)} {...props} />;
  };

function Title({ className, ...props }: ComponentProps<"h3">) {
  return <h3 className={join("ui-empty-title", className)} {...props} />;
}

function Description({ className, ...props }: ComponentProps<"p">) {
  return <p className={join("ui-empty-description", className)} {...props} />;
}

export const Empty = {
  Root: part("root"),
  Icon: part("icon"),
  Title,
  Description,
  Actions: part("actions"),
};
```

## Example

```tsx
import { Button, Empty } from "@replicas/ui";

export default function EmptyDemo() {
  return (
    <Empty.Root>
      <Empty.Icon>
        <svg viewBox="0 0 24 24" fill="none" aria-hidden>
          <rect x="4" y="5" width="16" height="14" rx="3" stroke="currentColor" strokeWidth="1.5" />
          <path d="M4 10h16" stroke="currentColor" strokeWidth="1.5" />
        </svg>
      </Empty.Icon>
      <Empty.Title>No files</Empty.Title>
      <Empty.Description>Files you upload will show up here.</Empty.Description>
      <Empty.Actions>
        <Button variant="primary">Upload file</Button>
      </Empty.Actions>
    </Empty.Root>
  );
}
```

## Foundations

The rest of the Codex style, as a skill: https://replicas.raphaelsalaja.com/skills/codex/SKILL.md