# Funnel chart

Compare ordered stage counts with exact values, proportional funnel shapes, and explicit unknown or increasing-count states.

Access: pro. Category: Data. Kind: composite.

## When to use

- Use it when a page needs compare ordered stage counts with exact values, proportional funnel shapes, and explicit unknown or increasing-count states.
- Choose it when the data structure, labels, and state are supplied by the application and must remain consumer controlled.

## Alternatives

- Choose analytics-card instead when explore revenue, compare periods and inspect chart values is the actual interface need, rather than funnel chart.

## 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 Funnel chart

```sh
npx shadcn@latest add @tidal-pro/funnel-chart
```

Stylesheets: `components/ui/tidal.css`, `components/ui/funnel-chart.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/funnel-chart.css";
import{TidalFunnelChart}from"./components/ui/funnel-chart";
export default()=><div className="tidal-scope"><TidalFunnelChart onSelectedChange={() => {}} selectedId={"example"} stages={[{id:"example",label:"Demo",value:1}]} title={"Demo"}/></div>;
```

## Structured props

- `TidalFunnelChart.onSelectedChange: (id: string, event: MouseEvent<HTMLButtonElement>) => void`: Callback invoked when the selected change interaction is proposed.
- `TidalFunnelChart.selectedId: string | null`: Required selected id value accepted by this exported component.
- `TidalFunnelChart.stages: ReadonlyArray<TidalFunnelStage>`: Required stages value accepted by this exported component.
- `TidalFunnelChart.title: ReactNode`: Required title value accepted by this exported component.
- `TidalFunnelChart.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalFunnelChart.disabled?: boolean | undefined` (default false): Optional disabled value accepted by this exported component.
- `TidalFunnelChart.formatValue?: ((value: number) => string) | undefined` (default String): Optional format value value accepted by this exported component.
- `TidalFunnelChart.headingLevel?: "h2" | "h3" | "h4" | "h5" | "h6" | undefined` (default "h2"): Optional heading level value accepted by this exported component.
- `TidalFunnelChart.labels?: Partial<{ empty: string; invalid: string; missing: string; warning: string; selection: string; select: string; }> | undefined` (default {}): Optional labels value accepted by this exported component.

## Complete usage example

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

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

import { useState } from "react";

import { TidalFunnelChart } from "./components/ui/funnel-chart";

import "./components/ui/funnel-chart.css";



const stages = [
  {
    id: "visits",
    label: "Product visits",
    value: 14400,
    detail: "People who visited the product page during the sample period.",
  },
  {
    id: "signup",
    label: "Signups",
    value: 6800,
    detail: "Accounts created during the same sample period.",
  },
  {
    id: "active",
    label: "Activated",
    value: 2480,
    detail: "Accounts that completed their first project.",
  },
  {
    id: "paid",
    label: "Paid accounts",
    value: 920,
    detail: "Accounts with a paid plan at the end of the period.",
  },
];

export function FunnelChartDemo() {
  const [id, setId] = useState<string | null>("active");
  return (
    <div style={{ width: "100%", maxWidth: 860 }}>
      <TidalFunnelChart
        title="Signup funnel"
        description="Compare supplied counts across four ordered stages."
        stages={stages}
        selectedId={id}
        onSelectedChange={setId}
        formatValue={(n) => new Intl.NumberFormat("en-US").format(n)}
      />
      <p style={{ fontSize: 11, color: "var(--t-muted)", textAlign: "center" }}>
        Fictional counts. Select a stage to inspect its definition.
      </p>
    </div>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <FunnelChartDemo />
    </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."}

Consumer-owned stages contain unique nonblank IDs/labels, finite nonnegative values or null, and optional detail/statistic content. Up to30 stages. selectedId is null or an existing stage. Native stage buttons propose selection after caller-first unprevented clicks, with direct native props/refs and disabled state. Button role and accessible name remain owned; missing, boolean or blank titles fail visibly while numeric zero remains valid. Exact values default to String, with optional formatter. Shape widths share one finite maximum; the next stage determines the lower edge, and a missing value remains explicitly unknown. Increasing counts show a visible comparability warning rather than a misleading conversion rate. No rates, losses, financial results or cohort equivalence are inferred. A persistent labelled root recovers focus when the previously focused owned button disappears or becomes disabled, only while focus remains on that exact source or body. Unrelated consumer focus is preserved. Native section props/ref, numeric-zero content, localized messages, h2-h6 hierarchy, narrow container stacking, RTL, reduced motion and forced colors are supported. No collection, analytics, request or persistence occurs.
