# Feature comparison table

A semantic comparison section with consumer-owned columns, feature states, text values, and native column actions.

Access: pro. Category: Marketing. Kind: composite.

## When to use

- Use it when a page needs a semantic comparison section with consumer-owned columns, feature states, text values, and native column actions.
- Choose it as the features region when composing a page from independently reusable TidalUI sections.

## Alternatives

- Choose feature-card instead when a feature summary with animated orbital artwork is the actual interface need, rather than feature comparison table.

## 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 Feature comparison table

```sh
npx shadcn@latest add @tidal-pro/feature-comparison-table
```

Stylesheets: `components/ui/tidal.css`, `components/ui/feature-comparison-table.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/feature-comparison-table.css";
import{TidalFeatureComparisonTable}from"./components/ui/feature-comparison-table";
export default(p:Parameters<typeof TidalFeatureComparisonTable>[0])=><div className="tidal-scope"><TidalFeatureComparisonTable {...p}/></div>;
```

## Structured props

- `TidalFeatureComparisonTable.caption: ReactNode`: Required caption value accepted by this exported component.
- `TidalFeatureComparisonTable.columns: ReadonlyArray<TidalComparisonColumn>`: Required columns value accepted by this exported component.
- `TidalFeatureComparisonTable.features: ReadonlyArray<TidalComparisonFeature>`: Required features value accepted by this exported component.
- `TidalFeatureComparisonTable.title: ReactNode`: Required title value accepted by this exported component.
- `TidalFeatureComparisonTable.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalFeatureComparisonTable.emptyMessage?: ReactNode` (default "No comparison details are available."): Optional empty message value accepted by this exported component.
- `TidalFeatureComparisonTable.eyebrow?: ReactNode`: Optional eyebrow value accepted by this exported component.
- `TidalFeatureComparisonTable.footer?: ReactNode`: Optional footer value accepted by this exported component.
- `TidalFeatureComparisonTable.headingLevel?: "h2" | "h3" | "h4" | undefined` (default "h2"): Optional heading level value accepted by this exported component.
- `TidalFeatureComparisonTable.labels?: Partial<TidalFeatureComparisonLabels> | undefined`: Optional labels value accepted by this exported component.
- `TidalFeatureComparisonTable.scrollProps?: Omit<HTMLAttributes<HTMLDivElement>, "aria-label" | "children"> | undefined`: Optional scroll props value accepted by this exported component.
- `TidalFeatureComparisonTable.scrollRef?: Ref<HTMLDivElement> | undefined`: Optional scroll ref value accepted by this exported component.
- `TidalFeatureComparisonTable.tableProps?: Omit<TableHTMLAttributes<HTMLTableElement>, "children"> | undefined`: Optional table props value accepted by this exported component.
- `TidalFeatureComparisonTable.tableRef?: Ref<HTMLTableElement> | undefined`: Optional table ref value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/feature-comparison-table.tsx) | [Manifest](https://tidalui.com/examples/feature-comparison-table.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, useMemo, useState } from "react";

import { TidalFeatureComparisonTable, type TidalComparisonColumn, type TidalComparisonFeature } from "./components/ui/feature-comparison-table";

import "./components/ui/feature-comparison-table.css";



const tidalExampleStyles = ".tidal-scope .feature-comparison-demo {\n  width: min(100%, 1080px);\n  margin-inline: auto;\n}\n\n.tidal-scope .feature-comparison-demo-switcher {\n  display: flex;\n  width: fit-content;\n  max-width: 100%;\n  gap: 3px;\n  margin: 0 auto 14px;\n  padding: 3px;\n  background: var(--t-subtle);\n  border: 1px solid var(--t-border);\n  border-radius: 13px;\n}\n\n.tidal-scope .feature-comparison-demo-switcher button {\n  min-width: 0;\n  min-height: 44px;\n  padding: 8px 15px;\n  color: var(--t-muted);\n  background: transparent;\n  border: 0;\n  border-radius: var(--t-radius-control);\n  font: inherit;\n  font-size: 11px;\n  font-weight: 720;\n  line-height: 1.25;\n  cursor: pointer;\n  overflow-wrap: anywhere;\n  transition:\n    color 180ms,\n    background 180ms,\n    box-shadow 180ms,\n    transform 140ms var(--t-ease-out);\n}\n\n.tidal-scope .feature-comparison-demo-switcher button[aria-pressed=\"true\"] {\n  color: var(--t-ink);\n  background: var(--t-surface);\n  box-shadow:\n    0 0 0 1px var(--t-border),\n    0 5px 14px -11px #000000a6;\n}\n\n.tidal-scope .feature-comparison-demo-switcher button:active {\n  transform: scale(0.97);\n}\n\n.tidal-scope .feature-comparison-demo-switcher button:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 2px;\n}\n\n.tidal-scope .feature-comparison-demo-status {\n  min-height: 1.4em;\n  margin: 11px 6px 0;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.4;\n  text-align: center;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .feature-comparison-demo-notes {\n  display: grid;\n  grid-template-columns: auto minmax(0, 1fr);\n  gap: 10px 16px;\n  margin-top: 12px;\n  padding: 15px 17px;\n  color: var(--t-muted);\n  background: var(--t-subtle);\n  border: 1px solid var(--t-border);\n  border-radius: var(--t-radius-control);\n  font-size: 11px;\n  line-height: 1.45;\n  scroll-margin-block: 20px;\n}\n\n.tidal-scope .feature-comparison-demo-notes strong {\n  color: var(--t-ink);\n  font-weight: 760;\n}\n\n.tidal-scope .feature-comparison-demo-notes span {\n  min-width: 0;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .feature-comparison-demo-notes:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 3px;\n}\n\n@container tidal-feature-comparison (max-width: 430px) {\n  .tidal-scope .feature-comparison-demo-switcher {\n    width: 100%;\n  }\n\n  .tidal-scope .feature-comparison-demo-switcher button {\n    flex: 1 1 0;\n    padding-inline: 10px;\n  }\n\n  .tidal-scope .feature-comparison-demo-notes {\n    grid-template-columns: minmax(0, 1fr);\n  }\n}\n\n@media (hover: none), (pointer: coarse) {\n  .tidal-scope .feature-comparison-demo-switcher button {\n    font-size: 16px;\n  }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .tidal-scope .feature-comparison-demo-switcher button {\n    transition-duration: 0s;\n  }\n\n  .tidal-scope .feature-comparison-demo-switcher button:active {\n    transform: none;\n  }\n}";

type ComparisonId = "workspace" | "review";

const FEATURES: Record<ComparisonId, readonly TidalComparisonFeature[]> = {
  workspace: [
    {
      id: "organize",
      label: "Primary organization",
      description: "How sample work is arranged",
      values: {
        board: { kind: "text", value: "Status columns" },
        list: { kind: "text", value: "Ordered rows" },
        calendar: { kind: "text", value: "Dated entries" },
      },
    },
    {
      id: "reorder",
      label: "Direct reordering",
      values: {
        board: { kind: "available" },
        list: { kind: "available" },
        calendar: { kind: "unavailable" },
      },
    },
    {
      id: "dates",
      label: "Date context",
      values: {
        board: { kind: "text", value: "Card detail" },
        list: { kind: "text", value: "Date column" },
        calendar: { kind: "available", label: "Visible on canvas" },
      },
    },
    {
      id: "scan",
      label: "Useful for",
      description: "Fictional sample use case",
      values: {
        board: { kind: "text", value: "Work stages" },
        list: { kind: "text", value: "Dense review" },
        calendar: { kind: "text", value: "Scheduled work" },
      },
    },
  ],
  review: [
    {
      id: "structure",
      label: "Review structure",
      values: {
        thread: { kind: "text", value: "Nested replies" },
        queue: { kind: "text", value: "Ordered decisions" },
        log: { kind: "text", value: "Chronological entries" },
      },
    },
    {
      id: "decision",
      label: "Explicit decision state",
      values: {
        thread: { kind: "unavailable" },
        queue: { kind: "available", label: "Approve or return" },
        log: { kind: "unavailable" },
      },
    },
    {
      id: "context",
      label: "Discussion context",
      values: {
        thread: { kind: "available" },
        queue: { kind: "text", value: "Decision note" },
        log: { kind: "text", value: "Entry detail" },
      },
    },
    {
      id: "scan",
      label: "Useful for",
      description: "Fictional sample use case",
      values: {
        thread: { kind: "text", value: "Open discussion" },
        queue: { kind: "text", value: "Formal review" },
        log: { kind: "text", value: "Change history" },
      },
    },
  ],
};

export function FeatureComparisonTableDemo() {
  const instanceId = useId().replace(/:/g, "");
  const [comparison, setComparison] = useState<ComparisonId>("workspace");
  const [selected, setSelected] = useState("board");
  const [message, setMessage] = useState(
    "Board view is selected for this local sample.",
  );
  const notesId = `feature-comparison-notes-${instanceId}`;

  const columns = useMemo<readonly TidalComparisonColumn[]>(() => {
    const choose = (id: string, label: string) => ({
      kind: "button" as const,
      id: `choose-${id}`,
      label: selected === id ? "Selected locally" : `Choose ${label}`,
      accessibleLabel: `Choose ${label} for the local sample`,
      variant: selected === id ? ("primary" as const) : ("secondary" as const),
      buttonProps: { "aria-pressed": selected === id },
      onAction: () => {
        setSelected(id);
        setMessage(`${label} is selected for this local sample.`);
      },
    });

    if (comparison === "workspace") {
      return [
        {
          id: "board",
          label: "Board view",
          accessibleLabel: "Board view",
          description: "Grouped by workflow state",
          badge: selected === "board" ? "Selected" : undefined,
          action: choose("board", "Board view"),
        },
        {
          id: "list",
          label: "List view",
          accessibleLabel: "List view",
          description: "Rows with visible fields",
          badge: selected === "list" ? "Selected" : undefined,
          action: choose("list", "List view"),
        },
        {
          id: "calendar",
          label: "Calendar view",
          accessibleLabel: "Calendar view",
          description: "Work arranged by date",
          badge: selected === "calendar" ? "Selected" : undefined,
          action: {
            kind: "link",
            id: "calendar-notes",
            label: "Read sample notes",
            accessibleLabel: "Read Calendar view sample notes",
            href: `#${notesId}`,
          },
        },
      ];
    }

    return [
      {
        id: "thread",
        label: "Comment thread",
        accessibleLabel: "Comment thread",
        description: "Conversation beside work",
        badge: selected === "thread" ? "Selected" : undefined,
        action: choose("thread", "Comment thread"),
      },
      {
        id: "queue",
        label: "Approval queue",
        accessibleLabel: "Approval queue",
        description: "Items awaiting a decision",
        badge: selected === "queue" ? "Selected" : undefined,
        action: choose("queue", "Approval queue"),
      },
      {
        id: "log",
        label: "Change log",
        accessibleLabel: "Change log",
        description: "A dated record of changes",
        badge: selected === "log" ? "Selected" : undefined,
        action: {
          kind: "link",
          id: "log-notes",
          label: "Read sample notes",
          accessibleLabel: "Read Change log sample notes",
          href: `#${notesId}`,
        },
      },
    ];
  }, [comparison, notesId, selected]);

  function changeComparison(next: ComparisonId) {
    setComparison(next);
    const nextSelected = next === "workspace" ? "board" : "thread";
    setSelected(nextSelected);
    setMessage(
      next === "workspace"
        ? "Workspace view comparison loaded locally."
        : "Review format comparison loaded locally.",
    );
  }

  return (
    <section
      className="feature-comparison-demo"
      aria-label="Feature comparison table preview"
    >
      <div
        className="feature-comparison-demo-switcher"
        aria-label="Sample comparison"
      >
        <button
          type="button"
          aria-pressed={comparison === "workspace"}
          onClick={() => changeComparison("workspace")}
        >
          Workspace views
        </button>
        <button
          type="button"
          aria-pressed={comparison === "review"}
          onClick={() => changeComparison("review")}
        >
          Review formats
        </button>
      </div>

      <TidalFeatureComparisonTable
        title={
          comparison === "workspace"
            ? "Compare workspace views"
            : "Compare review formats"
        }
        caption={
          comparison === "workspace"
            ? "Fictional comparison of Board, List and Calendar workspace views"
            : "Fictional comparison of Comment thread, Approval queue and Change log review formats"
        }
        description="Switch the sample, compare literal capabilities, and choose one option in local preview state."
        columns={columns}
        features={FEATURES[comparison]}
        footer="Fictional comparison data and local React state. No workspace, account, request, storage, or backend is connected."
      />

      <p
        className="feature-comparison-demo-status"
        role="status"
        aria-live="polite"
      >
        {message}
      </p>
      <aside
        id={notesId}
        className="feature-comparison-demo-notes"
        tabIndex={-1}
      >
        <strong>Sample notes</strong>
        <span>
          Each format shows a different arrangement of the same fictional work.
          This link changes only the page position.
        </span>
      </aside>
    </section>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <FeatureComparisonTableDemo />
    </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.","Arrow-key behavior follows the exported composite-control implementation."],"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, accessible native table caption, consumer-owned columns and features are required. Columns require unique ids, visible labels and accessible labels, with optional descriptions, badges and native link/button actions. Features require unique ids, visible labels and a value record keyed by column id. Values are typed available, unavailable or text states; omitted entries render an explicit consumer-labelled Not specified state. Available/unavailable and no-action labels may be consumer-owned ReactNode values and preserve numeric zero. Link actions preserve href, modified navigation, native attributes/ref and explicit aria-disabled false; disabled or aria-disabled true links suppress caller handling and navigation. Button actions preserve native attributes/ref/form ownership/type(default button), disabled state and prevented-handler composition. Optional headingLevel, eyebrow, description, labels, emptyMessage, footer, table/scroll attributes and refs, and native section attributes/ref remain consumer-owned. The native table uses column and row headers, an accessible caption and an intentional horizontal region with a sticky first label column when overflow occurs. The component performs no pricing, checkout, purchase, request, account, storage, analytics or backend action.
