# Empty state section

A responsive blank, no-results, error, or permission state with consumer-owned native actions and outcomes.

Access: pro. Category: Blocks. Kind: section.

## When to use

- Use it when a page needs a responsive blank, no-results, error, or permission state with consumer-owned native actions and outcomes.
- Choose it inside an authenticated product surface when the host application owns routing, persistence, and service calls.

## Alternatives

- Choose empty-state instead when use the compact state inside a card, panel, table, or other bounded surface.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Empty state section

```sh
npx shadcn@latest add @tidal-pro/empty-state-section
```

Stylesheets: `components/ui/tidal.css`, `components/ui/empty-state-section.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/empty-state-section.css";
import{TidalEmptyStateSection}from"./components/ui/empty-state-section";
export default()=><div className="tidal-scope"><TidalEmptyStateSection title={"Demo"}/></div>;
```

## Structured props

- `TidalEmptyStateSection.title: ReactNode`: Required title value accepted by this exported component.
- `TidalEmptyStateSection.actions?: ReadonlyArray<TidalEmptyStateAction> | undefined` (default []): Optional actions value accepted by this exported component.
- `TidalEmptyStateSection.actionsLabel?: string | undefined` (default "State actions"): Optional actions label value accepted by this exported component.
- `TidalEmptyStateSection.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalEmptyStateSection.detail?: ReactNode`: Optional detail value accepted by this exported component.
- `TidalEmptyStateSection.detailLabel?: ReactNode` (default "Context"): Optional detail label value accepted by this exported component.
- `TidalEmptyStateSection.emptyActionsMessage?: ReactNode`: Optional empty actions message value accepted by this exported component.
- `TidalEmptyStateSection.footer?: ReactNode`: Optional footer value accepted by this exported component.
- `TidalEmptyStateSection.headingLevel?: "h2" | "h3" | "h4" | undefined` (default "h2"): Optional heading level value accepted by this exported component.
- `TidalEmptyStateSection.stateLabel?: ReactNode`: Optional state label value accepted by this exported component.
- `TidalEmptyStateSection.variant?: TidalEmptyStateVariant | undefined` (default "blank"): Optional variant value accepted by this exported component.
- `TidalEmptyStateSection.visual?: ReactNode`: Optional visual value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/empty-state-section.tsx) | [Manifest](https://tidalui.com/examples/empty-state-section.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
"use client";

import "./components/ui/tidal.css";

import { useId, useLayoutEffect, useMemo, useRef, useState } from "react";

import { TidalEmptyStateSection, type TidalEmptyStateAction, type TidalEmptyStateVariant } from "./components/ui/empty-state-section";

import "./components/ui/empty-state-section.css";



const tidalExampleStyles = ".tidal-scope .empty-section-demo,\n.tidal-scope .empty-section-demo * {\n  box-sizing: border-box;\n}\n\n.tidal-scope .empty-section-demo {\n  display: grid;\n  width: 100%;\n  max-width: 1120px;\n  min-width: 0;\n  gap: 16px;\n  color: var(--t-ink);\n  container: empty-section-demo / inline-size;\n}\n\n.tidal-scope .empty-section-demo-controls {\n  display: grid;\n  width: min(100%, 620px);\n  min-width: 0;\n  grid-template-columns: repeat(4, minmax(0, 1fr));\n  gap: 6px;\n  padding: 6px;\n  border: 1px solid var(--t-border);\n  border-radius: 14px;\n  background: var(--t-subtle);\n}\n\n.tidal-scope .empty-section-demo-controls button {\n  min-width: 0;\n  min-height: 44px;\n  padding: 8px 10px;\n  border: 1px solid transparent;\n  border-radius: 9px;\n  background: transparent;\n  color: var(--t-muted);\n  font: inherit;\n  font-size: 11px;\n  font-weight: 650;\n  line-height: 1.35;\n  overflow-wrap: anywhere;\n  cursor: pointer;\n  transition:\n    background 160ms,\n    color 160ms,\n    border-color 160ms,\n    transform 140ms var(--t-ease-out);\n}\n\n.tidal-scope .empty-section-demo-controls button[aria-pressed=\"true\"] {\n  border-color: var(--t-ink);\n  background: var(--t-ink);\n  color: var(--t-surface);\n}\n\n.tidal-scope .empty-section-demo-controls button:hover {\n  border-color: var(--t-border-strong);\n}\n\n.tidal-scope .empty-section-demo-controls button:active {\n  transform: scale(0.98);\n}\n\n.tidal-scope .empty-section-demo-controls button:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 3px;\n}\n\n.tidal-scope .empty-section-demo-notes {\n  display: grid;\n  grid-template-columns: repeat(2, minmax(0, 1fr));\n  gap: 10px;\n  min-width: 0;\n}\n\n.tidal-scope .empty-section-demo-notes article {\n  min-width: 0;\n  padding: 14px 16px;\n  border: 1px solid var(--t-border);\n  border-radius: 10px;\n  background: var(--t-surface);\n  scroll-margin-block: 18px;\n}\n\n.tidal-scope .empty-section-demo-notes article:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 3px;\n}\n\n.tidal-scope .empty-section-demo-notes strong {\n  display: block;\n  font-size: 11px;\n  font-weight: 680;\n  line-height: 1.4;\n}\n\n.tidal-scope .empty-section-demo-notes p {\n  margin: 5px 0 0;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.55;\n  overflow-wrap: anywhere;\n}\n\n@container empty-section-demo (max-width: 520px) {\n  .tidal-scope .empty-section-demo-controls {\n    grid-template-columns: repeat(2, minmax(0, 1fr));\n  }\n\n  .tidal-scope .empty-section-demo-notes {\n    grid-template-columns: minmax(0, 1fr);\n  }\n}\n\n@media (hover: none) and (pointer: coarse) {\n  .tidal-scope .empty-section-demo-controls button {\n    font-size: 16px;\n  }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .tidal-scope .empty-section-demo-controls button {\n    transition: none;\n  }\n}";

const VARIANTS: readonly { id: TidalEmptyStateVariant; label: string }[] = [
  { id: "blank", label: "Blank" },
  { id: "no-results", label: "No results" },
  { id: "error", label: "Error" },
  { id: "permission", label: "Permission" },
];

const COPY: Record<
  TidalEmptyStateVariant,
  { title: string; description: string; detailLabel: string }
> = {
  blank: {
    title: "Start with a first project",
    description:
      "Prepare a local draft or review how this empty view behaves before connecting product data.",
    detailLabel: "Local drafts",
  },
  "no-results": {
    title: "No projects match this query",
    description:
      "The fictional filter is active. Clear it locally to return to the blank workspace sample.",
    detailLabel: "Sample query",
  },
  error: {
    title: "The sample view could not load",
    description:
      "This is a rendered error state. Retry only increments a local preview counter and makes no request.",
    detailLabel: "Local retries",
  },
  permission: {
    title: "You need access to this view",
    description:
      "Read the local access note or acknowledge it in this preview. No permission or account changes.",
    detailLabel: "Preview status",
  },
};

export function EmptyStateSectionDemo() {
  const generatedId = useId().replace(/:/g, "");
  const behaviorNoteId = `empty-demo-${generatedId}-behavior`;
  const permissionNoteId = `empty-demo-${generatedId}-permission`;
  const [variant, setVariant] = useState<TidalEmptyStateVariant>("blank");
  const [drafts, setDrafts] = useState(0);
  const [retries, setRetries] = useState(0);
  const [permissionAcknowledged, setPermissionAcknowledged] = useState(false);
  const [query, setQuery] = useState("status:blocked");
  const [message, setMessage] = useState(
    "Blank workspace sample selected. Nothing has been created.",
  );
  const blankControlRef = useRef<HTMLButtonElement>(null);
  const noResultsControlRef = useRef<HTMLButtonElement>(null);
  const errorControlRef = useRef<HTMLButtonElement>(null);
  const permissionControlRef = useRef<HTMLButtonElement>(null);
  const pendingVariantFocus = useRef<TidalEmptyStateVariant | null>(null);

  useLayoutEffect(() => {
    if (pendingVariantFocus.current !== variant) return;
    pendingVariantFocus.current = null;
    const target = {
      blank: blankControlRef.current,
      "no-results": noResultsControlRef.current,
      error: errorControlRef.current,
      permission: permissionControlRef.current,
    }[variant];
    target?.focus({ preventScroll: true });
  }, [permissionAcknowledged, variant]);

  const actions = useMemo<readonly TidalEmptyStateAction[]>(() => {
    if (variant === "blank") {
      return [
        {
          kind: "button",
          id: "prepare-draft",
          label: "Prepare local draft",
          variant: "primary",
          icon: <span>+</span>,
          onAction: () => {
            setDrafts((count) => count + 1);
            setMessage(
              "A sample draft was prepared in memory. No project or account was created.",
            );
          },
        },
        {
          kind: "link",
          id: "review-behavior",
          label: "Review local behavior",
          href: `#${behaviorNoteId}`,
          icon: <span>↗</span>,
          linkProps: {
            onClick: () =>
              setMessage("The in-page behavior note was selected."),
          },
        },
      ];
    }

    if (variant === "no-results") {
      return [
        {
          kind: "button",
          id: "clear-query",
          label: "Clear sample query",
          variant: "primary",
          icon: <span>×</span>,
          onAction: () => {
            setQuery("");
            pendingVariantFocus.current = "blank";
            setVariant("blank");
            setMessage(
              "The fictional query was cleared. The blank sample is visible.",
            );
          },
        },
      ];
    }

    if (variant === "error") {
      return [
        {
          kind: "button",
          id: "retry-preview",
          label: "Retry local preview",
          variant: "primary",
          icon: <span>↻</span>,
          onAction: () => {
            setRetries((count) => count + 1);
            setMessage(
              "The retry counter changed locally. No server or service was contacted.",
            );
          },
        },
        {
          kind: "link",
          id: "error-note",
          label: "Read behavior note",
          href: `#${behaviorNoteId}`,
        },
      ];
    }

    return [
      {
        kind: "link",
        id: "access-note",
        label: "Read access note",
        href: `#${permissionNoteId}`,
        variant: "primary",
        icon: <span>↗</span>,
        linkProps: {
          onClick: () => setMessage("The in-page access note was selected."),
        },
      },
      {
        kind: "button",
        id: "acknowledge",
        label: permissionAcknowledged
          ? "Acknowledged locally"
          : "Acknowledge locally",
        disabled: permissionAcknowledged,
        onAction: () => {
          pendingVariantFocus.current = "permission";
          setPermissionAcknowledged(true);
          setMessage(
            "The sample note was acknowledged locally. No permission changed.",
          );
        },
      },
    ];
  }, [behaviorNoteId, permissionAcknowledged, permissionNoteId, variant]);

  const activeCopy = COPY[variant];
  const detail =
    variant === "blank"
      ? `${drafts} prepared in memory`
      : variant === "no-results"
        ? query || "No query"
        : variant === "error"
          ? `${retries} local ${retries === 1 ? "retry" : "retries"}`
          : permissionAcknowledged
            ? "Acknowledged locally"
            : "No access granted";

  function selectVariant(nextVariant: TidalEmptyStateVariant) {
    setVariant(nextVariant);
    if (nextVariant === "no-results" && !query) setQuery("status:blocked");
    setMessage(
      `${VARIANTS.find((item) => item.id === nextVariant)?.label ?? "State"} sample selected. Changes remain local.`,
    );
  }

  return (
    <section
      className="empty-section-demo"
      aria-label="Empty state section preview"
    >
      <div
        className="empty-section-demo-controls"
        role="group"
        aria-label="Choose empty state sample"
      >
        {VARIANTS.map((item) => (
          <button
            key={item.id}
            ref={
              item.id === "blank"
                ? blankControlRef
                : item.id === "no-results"
                  ? noResultsControlRef
                  : item.id === "error"
                    ? errorControlRef
                    : permissionControlRef
            }
            type="button"
            aria-pressed={variant === item.id}
            onClick={() => selectVariant(item.id)}
          >
            {item.label}
          </button>
        ))}
      </div>

      <TidalEmptyStateSection
        variant={variant}
        title={activeCopy.title}
        description={activeCopy.description}
        detailLabel={activeCopy.detailLabel}
        detail={detail}
        actions={actions}
        footer={
          <span role="status" aria-live="polite">
            {message}
          </span>
        }
      />

      <div className="empty-section-demo-notes">
        <article id={behaviorNoteId} tabIndex={-1}>
          <strong>Local behavior note</strong>
          <p>
            Buttons in this preview update React state only. Links stay on this
            page. No request, project, record, or stored result is created.
          </p>
        </article>
        <article id={permissionNoteId} tabIndex={-1}>
          <strong>Access note</strong>
          <p>
            Permission changes belong to the consuming product. This sample
            cannot grant access, contact an administrator, or change an account.
          </p>
        </article>
      </div>
    </section>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <EmptyStateSectionDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

title is required. variant is blank(default) | no-results | error | permission and selects neutral visual/state styling only. Optional stateLabel, visual, description, detail/detailLabel, footer and emptyActionsMessage are consumer-owned ReactNode values. Actions are discriminated native links with href/linkProps/ref or buttons with onAction/buttonProps/ref, optional icon, primary/secondary variant and disabled state. Link aria-disabled true resolves disabled semantics, removes the destination from tab order and suppresses navigation/caller handling while false is preserved. Button type defaults to button; native onClick runs before onAction and preventDefault suppresses the higher callback. The section forwards native attributes/ref and headingLevel h2(default) | h3 | h4. The component performs no search, retry, creation, permission, request, storage or result side effect.
