---
title: "Analytics Dashboard · UI SDK — StyleX Blocks"
description: "Three-band analytics screen: a multi-series active-sessions chart and KPI sparkline tiles, audience stacked bar cards, and supporting top-routes and top-interactions activity tables."
url: "https://stylexblocks.com/block/ui-sdk/analytics-dashboard/"
agent:
  instructions: "Use this search API to find relevant components and blocks across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://stylexblocks.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Analytics Dashboard block

Three-band analytics screen: a multi-series active-sessions chart and KPI sparkline tiles, audience stacked bar cards, and supporting top-routes and top-interactions activity tables.

- Behavior engine: UI SDK
- Category: [Dashboards](https://stylexblocks.com/blocks/dashboards.md)
- Built with: [Button](https://stylexblocks.com/components/ui-sdk/button.md), [Card](https://stylexblocks.com/components/ui-sdk/card.md), [Chart](https://stylexblocks.com/components/ui-sdk/chart.md), [Grid](https://stylexblocks.com/components/ui-sdk/grid.md), [Heading](https://stylexblocks.com/components/ui-sdk/heading.md), [Link](https://stylexblocks.com/components/ui-sdk/link.md), [Progress](https://stylexblocks.com/components/ui-sdk/progress.md), [Separator](https://stylexblocks.com/components/ui-sdk/separator.md), [Stack](https://stylexblocks.com/components/ui-sdk/stack.md), [Stat](https://stylexblocks.com/components/ui-sdk/stat.md), [Table](https://stylexblocks.com/components/ui-sdk/table.md), [Text](https://stylexblocks.com/components/ui-sdk/text.md), [Toast](https://stylexblocks.com/components/ui-sdk/toast.md), [Visually Hidden](https://stylexblocks.com/components/ui-sdk/visually-hidden.md)
- HTML page: https://stylexblocks.com/block/ui-sdk/analytics-dashboard/

## Install

Configure the project once (sets the behavior engine and import aliases):

```sh
npx stylexblocks init --style ui-sdk
```

Then add the item as source you own:

```sh
npx stylexblocks add analytics-dashboard
```

Equivalent: `npx shadcn add @stylexblocks/analytics-dashboard`. Registry item JSON: https://stylexblocks.com/r/ui-sdk/analytics-dashboard.json

## Usage

```tsx
import { AnalyticsDashboard } from "#components/blocks/ui-sdk/analytics-dashboard.tsx";

export function Example() {
  return (
    <div style={{ height: "100dvh" }}>
      <AnalyticsDashboard />
    </div>
  );
}
```

## Source

`components/blocks/ui-sdk/analytics-dashboard.tsx`

```tsx
import * as stylex from "@stylexjs/stylex";
import { useMemo } from "react";
import { Button } from "#components/ui/ui-sdk/button.tsx";
import { Card } from "#components/ui/ui-sdk/card.tsx";
import {
  CategoryBar,
  LineChart,
  Sparkline,
  type ChartColorName,
} from "#components/ui/ui-sdk/chart.tsx";
import { Grid } from "#components/ui/ui-sdk/grid.tsx";
import { Heading } from "#components/ui/ui-sdk/heading.tsx";
import { Link } from "#components/ui/ui-sdk/link.tsx";
import { Progress } from "#components/ui/ui-sdk/progress.tsx";
import { Separator } from "#components/ui/ui-sdk/separator.tsx";
import { HStack, VStack } from "#components/ui/ui-sdk/stack.tsx";
import { Stat } from "#components/ui/ui-sdk/stat.tsx";
import { Table } from "#components/ui/ui-sdk/table.tsx";
import { Text } from "#components/ui/ui-sdk/text.tsx";
import { Toast, Toaster } from "#components/ui/ui-sdk/toast.tsx";
import { VisuallyHidden } from "#components/ui/ui-sdk/visually-hidden.tsx";
import { semanticColors } from "@stylexblocks/ui/semantic-tokens/colors.stylex.ts";
import { bluePalette } from "@stylexblocks/ui/themes/palettes.ts";
import { fonts } from "@stylexblocks/ui/tokens/fonts.stylex.ts";
import { spacing } from "@stylexblocks/ui/tokens/spacing.stylex.ts";
import type { StyleOverrideProps } from "#lib/recipe-props.ts";

interface ActiveSessionPoint {
  slot: number;
  label: string;
  total: number;
  web: number;
  mobile: number;
}

const ACTIVE_SESSIONS_DATA: ActiveSessionPoint[] = [
  { slot: 0, label: "Nov 18 09:00", total: 94, web: 64, mobile: 30 },
  { slot: 1, label: "Nov 18 09:15", total: 98, web: 67, mobile: 31 },
  { slot: 2, label: "Nov 18 09:30", total: 103, web: 71, mobile: 32 },
  { slot: 3, label: "Nov 18 09:45", total: 107, web: 74, mobile: 33 },
  { slot: 4, label: "Nov 18 10:00", total: 112, web: 78, mobile: 34 },
  { slot: 5, label: "Nov 18 10:15", total: 118, web: 82, mobile: 36 },
  { slot: 6, label: "Nov 18 10:30", total: 121, web: 84, mobile: 37 },
  { slot: 7, label: "Nov 18 10:45", total: 125, web: 88, mobile: 37 },
  { slot: 8, label: "Nov 18 11:00", total: 128, web: 90, mobile: 38 },
  { slot: 9, label: "Nov 18 11:15", total: 126, web: 88, mobile: 38 },
  { slot: 10, label: "Nov 18 11:30", total: 124, web: 86, mobile: 38 },
  { slot: 11, label: "Nov 18 11:45", total: 120, web: 81, mobile: 39 },
  { slot: 12, label: "Nov 18 12:00", total: 115, web: 74, mobile: 41 },
  { slot: 13, label: "Nov 18 12:15", total: 111, web: 68, mobile: 43 },
  { slot: 14, label: "Nov 18 12:30", total: 109, web: 64, mobile: 45 },
  { slot: 15, label: "Nov 18 12:45", total: 112, web: 66, mobile: 46 },
  { slot: 16, label: "Nov 18 13:00", total: 118, web: 71, mobile: 47 },
  { slot: 17, label: "Nov 18 13:15", total: 123, web: 77, mobile: 46 },
  { slot: 18, label: "Nov 18 13:30", total: 129, web: 84, mobile: 45 },
  { slot: 19, label: "Nov 18 13:45", total: 132, web: 88, mobile: 44 },
  { slot: 20, label: "Nov 18 14:00", total: 136, web: 93, mobile: 43 },
  { slot: 21, label: "Nov 18 14:15", total: 138, web: 96, mobile: 42 },
  { slot: 22, label: "Nov 18 14:30", total: 135, web: 94, mobile: 41 },
  { slot: 23, label: "Nov 18 14:45", total: 131, web: 91, mobile: 40 },
  { slot: 24, label: "Nov 18 15:00", total: 127, web: 87, mobile: 40 },
  { slot: 25, label: "Nov 18 15:15", total: 124, web: 84, mobile: 40 },
  { slot: 26, label: "Nov 18 15:30", total: 121, web: 81, mobile: 40 },
  { slot: 27, label: "Nov 18 15:45", total: 118, web: 77, mobile: 41 },
  { slot: 28, label: "Nov 18 16:00", total: 114, web: 72, mobile: 42 },
  { slot: 29, label: "Nov 18 16:15", total: 110, web: 67, mobile: 43 },
  { slot: 30, label: "Nov 18 16:30", total: 105, web: 61, mobile: 44 },
  { slot: 31, label: "Nov 18 16:45", total: 101, web: 56, mobile: 45 },
  { slot: 32, label: "Nov 18 17:00", total: 96, web: 50, mobile: 46 },
  { slot: 33, label: "Nov 18 17:15", total: 92, web: 45, mobile: 47 },
  { slot: 34, label: "Nov 18 17:30", total: 88, web: 41, mobile: 47 },
  { slot: 35, label: "Nov 18 17:45", total: 85, web: 39, mobile: 46 },
  { slot: 36, label: "Nov 18 18:00", total: 82, web: 37, mobile: 45 },
  { slot: 37, label: "Nov 18 18:15", total: 79, web: 35, mobile: 44 },
  { slot: 38, label: "Nov 18 18:30", total: 77, web: 34, mobile: 43 },
  { slot: 39, label: "Nov 18 18:45", total: 75, web: 33, mobile: 42 },
  { slot: 40, label: "Nov 18 19:00", total: 74, web: 33, mobile: 41 },
  { slot: 41, label: "Nov 18 19:15", total: 73, web: 33, mobile: 40 },
  { slot: 42, label: "Nov 18 19:30", total: 72, web: 34, mobile: 38 },
  { slot: 43, label: "Nov 18 19:45", total: 70, web: 34, mobile: 36 },
  { slot: 44, label: "Nov 18 20:00", total: 68, web: 34, mobile: 34 },
  { slot: 45, label: "Nov 18 20:15", total: 66, web: 34, mobile: 32 },
  { slot: 46, label: "Nov 18 20:30", total: 64, web: 34, mobile: 30 },
  { slot: 47, label: "Nov 18 20:45", total: 61, web: 33, mobile: 28 },
  { slot: 48, label: "Nov 18 21:00", total: 58, web: 32, mobile: 26 },
  { slot: 49, label: "Nov 18 21:15", total: 55, web: 31, mobile: 24 },
  { slot: 50, label: "Nov 18 21:30", total: 53, web: 31, mobile: 22 },
  { slot: 51, label: "Nov 18 21:45", total: 50, web: 30, mobile: 20 },
  { slot: 52, label: "Nov 18 22:00", total: 48, web: 29, mobile: 19 },
  { slot: 53, label: "Nov 18 22:15", total: 46, web: 28, mobile: 18 },
  { slot: 54, label: "Nov 18 22:30", total: 44, web: 27, mobile: 17 },
  { slot: 55, label: "Nov 18 22:45", total: 43, web: 27, mobile: 16 },
  { slot: 56, label: "Nov 18 23:00", total: 41, web: 26, mobile: 15 },
  { slot: 57, label: "Nov 18 23:15", total: 40, web: 25, mobile: 15 },
  { slot: 58, label: "Nov 18 23:30", total: 39, web: 24, mobile: 15 },
  { slot: 59, label: "Nov 18 23:45", total: 38, web: 24, mobile: 14 },
  { slot: 60, label: "Nov 19 00:00", total: 37, web: 23, mobile: 14 },
  { slot: 61, label: "Nov 19 00:15", total: 36, web: 22, mobile: 14 },
  { slot: 62, label: "Nov 19 00:30", total: 36, web: 22, mobile: 14 },
  { slot: 63, label: "Nov 19 00:45", total: 35, web: 21, mobile: 14 },
  { slot: 64, label: "Nov 19 01:00", total: 36, web: 21, mobile: 15 },
  { slot: 65, label: "Nov 19 01:15", total: 37, web: 22, mobile: 15 },
  { slot: 66, label: "Nov 19 01:30", total: 38, web: 23, mobile: 15 },
  { slot: 67, label: "Nov 19 01:45", total: 39, web: 23, mobile: 16 },
  { slot: 68, label: "Nov 19 02:00", total: 41, web: 24, mobile: 17 },
  { slot: 69, label: "Nov 19 02:15", total: 43, web: 25, mobile: 18 },
  { slot: 70, label: "Nov 19 02:30", total: 45, web: 26, mobile: 19 },
  { slot: 71, label: "Nov 19 02:45", total: 47, web: 28, mobile: 19 },
  { slot: 72, label: "Nov 19 03:00", total: 50, web: 30, mobile: 20 },
  { slot: 73, label: "Nov 19 03:15", total: 53, web: 32, mobile: 21 },
  { slot: 74, label: "Nov 19 03:30", total: 56, web: 35, mobile: 21 },
  { slot: 75, label: "Nov 19 03:45", total: 59, web: 37, mobile: 22 },
  { slot: 76, label: "Nov 19 04:00", total: 63, web: 40, mobile: 23 },
  { slot: 77, label: "Nov 19 04:15", total: 66, web: 43, mobile: 23 },
  { slot: 78, label: "Nov 19 04:30", total: 70, web: 46, mobile: 24 },
  { slot: 79, label: "Nov 19 04:45", total: 74, web: 49, mobile: 25 },
  { slot: 80, label: "Nov 19 05:00", total: 78, web: 52, mobile: 26 },
  { slot: 81, label: "Nov 19 05:15", total: 82, web: 55, mobile: 27 },
  { slot: 82, label: "Nov 19 05:30", total: 86, web: 58, mobile: 28 },
  { slot: 83, label: "Nov 19 05:45", total: 89, web: 60, mobile: 29 },
  { slot: 84, label: "Nov 19 06:00", total: 93, web: 63, mobile: 30 },
  { slot: 85, label: "Nov 19 06:15", total: 96, web: 66, mobile: 30 },
  { slot: 86, label: "Nov 19 06:30", total: 99, web: 68, mobile: 31 },
  { slot: 87, label: "Nov 19 06:45", total: 102, web: 70, mobile: 32 },
  { slot: 88, label: "Nov 19 07:00", total: 105, web: 73, mobile: 32 },
  { slot: 89, label: "Nov 19 07:15", total: 108, web: 75, mobile: 33 },
  { slot: 90, label: "Nov 19 07:30", total: 111, web: 78, mobile: 33 },
  { slot: 91, label: "Nov 19 07:45", total: 114, web: 80, mobile: 34 },
  { slot: 92, label: "Nov 19 08:00", total: 117, web: 82, mobile: 35 },
  { slot: 93, label: "Nov 19 08:15", total: 120, web: 85, mobile: 35 },
  { slot: 94, label: "Nov 19 08:30", total: 122, web: 86, mobile: 36 },
  { slot: 95, label: "Nov 19 09:00", total: 124, web: 88, mobile: 36 },
];

const ACTIVE_SESSIONS_CHART_DATA = ACTIVE_SESSIONS_DATA.map((pt) => ({
  label: pt.label,
  "Total Sessions": pt.total,
  Web: pt.web,
  Mobile: pt.mobile,
}));

const RAW_METRICS = [
  {
    label: "Weekly Active Users",
    value: "64.8 k",
    change: "+21.4%",
    positive: true,
    sparkline: [
      34, 37, 40, 39, 43, 28, 25, 42, 45, 44, 48, 51, 31, 29, 49, 53, 52, 56, 58, 35, 33, 57, 61,
      63, 66, 69, 42, 39, 71, 74,
    ],
  },
  {
    label: "Docs Page Views",
    value: "142.6 k",
    change: "+15.8%",
    positive: true,
    sparkline: [
      44, 42, 46, 48, 47, 22, 20, 49, 51, 50, 53, 55, 25, 23, 54, 57, 56, 59, 62, 29, 26, 61, 64,
      67, 65, 70, 34, 31, 72, 76,
    ],
  },
  {
    label: "Median Read Time",
    value: "3.8 min",
    change: "+6.2%",
    positive: true,
    sparkline: [
      38, 40, 39, 41, 42, 34, 32, 41, 43, 44, 42, 45, 36, 35, 44, 46, 47, 45, 48, 39, 38, 49, 50,
      52, 51, 53, 44, 43, 54, 56,
    ],
  },
  {
    label: "Exit Rate",
    value: "34.1%",
    change: "-5.4%",
    positive: false,
    sparkline: [
      54, 52, 55, 51, 50, 56, 54, 49, 48, 50, 47, 46, 51, 49, 45, 44, 43, 42, 40, 45, 43, 39, 38,
      37, 36, 35, 39, 37, 34, 32,
    ],
  },
] as const;

const METRICS = RAW_METRICS.map((metric) => ({
  ...metric,
  sparklineData: metric.sparkline.map((value, idx) => ({
    day: `Day ${idx + 1}`,
    value,
  })),
}));

interface SegmentItem {
  label: string;
  value: number;
  color: ChartColorName;
}

const GEOGRAPHY_DATA: SegmentItem[] = [
  { label: "North America", value: 42, color: "blue" },
  { label: "Europe", value: 31, color: "orange" },
  { label: "Asia-Pacific", value: 18, color: "emerald" },
  { label: "Latin America", value: 6, color: "violet" },
  { label: "Other", value: 3, color: "slate" },
];

const DISCIPLINE_DATA: SegmentItem[] = [
  { label: "Frontend", value: 48, color: "blue" },
  { label: "Full-Stack", value: 24, color: "orange" },
  { label: "Design Systems", value: 14, color: "emerald" },
  { label: "Platform", value: 9, color: "violet" },
  { label: "Other", value: 5, color: "slate" },
];

const TOP_ROUTES = [
  { id: "1", route: "/blocks", views: 12840, newUsers: "58.4%", avgTime: "4:18" },
  { id: "2", route: "/components/button", views: 9420, newUsers: "41.2%", avgTime: "3:26" },
  { id: "3", route: "/components/dialog", views: 7860, newUsers: "36.9%", avgTime: "4:52" },
  { id: "4", route: "/components/combobox", views: 6510, newUsers: "49.5%", avgTime: "5:14" },
  { id: "5", route: "/blocks/dashboards", views: 5390, newUsers: "64.1%", avgTime: "3:49" },
  { id: "6", route: "/components/table", views: 4620, newUsers: "33.7%", avgTime: "5:05" },
  { id: "7", route: "/components/tabs", views: 3980, newUsers: "44.0%", avgTime: "2:47" },
  { id: "8", route: "/components/menu", views: 3440, newUsers: "31.8%", avgTime: "4:11" },
  { id: "9", route: "/blocks/ai", views: 2890, newUsers: "68.2%", avgTime: "4:36" },
  { id: "10", route: "/changelog", views: 2150, newUsers: "24.6%", avgTime: "3:12" },
];

const TOP_INTERACTIONS = [
  { id: "1", event: "copy_code", count: 24180, users: 14620, newUsers: 5380 },
  { id: "2", event: "engine_switch", count: 16940, users: 10210, newUsers: 4190 },
  { id: "3", event: "preview_interact", count: 13520, users: 8940, newUsers: 3610 },
  { id: "4", event: "cli_copy", count: 9280, users: 6430, newUsers: 2890 },
  { id: "5", event: "search_query", count: 6810, users: 4720, newUsers: 1940 },
  { id: "6", event: "theme_toggle", count: 5140, users: 3890, newUsers: 1420 },
  { id: "7", event: "block_fullscreen", count: 3760, users: 2810, newUsers: 1120 },
  { id: "8", event: "filter_category", count: 2940, users: 2190, newUsers: 870 },
  { id: "9", event: "docs_export", count: 1820, users: 1340, newUsers: 520 },
  { id: "10", event: "share_link", count: 1190, users: 890, newUsers: 340 },
];

const MAX_ROUTE_VIEWS = Math.max(...TOP_ROUTES.map((r) => r.views));
const MAX_INTERACTION_COUNT = Math.max(...TOP_INTERACTIONS.map((r) => r.count));

const styles = stylex.create({
  root: {
    backgroundColor: semanticColors.bg,
    color: semanticColors.fg,
    display: "flex",
    flexDirection: "column",
    fontFamily: fonts.body,
    height: "100%",
    minHeight: 0,
    overflowY: "auto",
    width: "100%",
  },
  content: {
    paddingBlock: spacing._6,
    paddingInline: spacing._6,
    width: "100%",
  },
  sectionHeading: {
    marginBlock: 0,
  },
  metricBody: {
    paddingBlock: spacing._4,
    paddingInline: spacing._4,
  },
  deltaIcon: {
    alignItems: "center",
    display: "inline-flex",
  },
  sparklineHost: {
    marginTop: spacing._1,
  },
  twoColGrid: {
    gridTemplateColumns: "repeat(auto-fit, minmax(20rem, 1fr))",
  },
  cardInner: {
    paddingBlock: spacing._5,
    paddingInline: spacing._5,
  },
  tableScroll: {
    overflowX: "auto",
    width: "100%",
  },
  progressCell: {
    minWidth: "7rem",
  },
});

function RefreshIcon() {
  return (
    <svg
      width="14"
      height="14"
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth="1.9"
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden="true"
    >
      <path d="M21 12a9 9 0 1 1-2.64-6.36" />
      <polyline points="21 3 21 9 15 9" />
    </svg>
  );
}

function ArrowUpIcon() {
  return (
    <svg
      width="13"
      height="13"
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth="2.25"
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden="true"
    >
      <line x1="12" y1="19" x2="12" y2="5" />
      <polyline points="5 12 12 5 19 12" />
    </svg>
  );
}

function ArrowDownIcon() {
  return (
    <svg
      width="13"
      height="13"
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth="2.25"
      strokeLinecap="round"
      strokeLinejoin="round"
      aria-hidden="true"
    >
      <line x1="12" y1="5" x2="12" y2="19" />
      <polyline points="19 12 12 19 5 12" />
    </svg>
  );
}

function AudienceDistributionCard({ title, data }: { title: string; data: SegmentItem[] }) {
  return (
    <Card.Root variant="outline">
      <VStack gap="4" style={styles.cardInner}>
        <Heading render={<h3 />} size="sm" style={styles.sectionHeading}>
          {title}
        </Heading>
        <CategoryBar
          values={data.map((seg) => seg.value)}
          labels={data.map((seg) => seg.label)}
          colors={data.map((seg) => seg.color)}
          valueFormatter={(value) => `${value}%`}
          ariaLabel={`${title} distribution`}
        />
      </VStack>
    </Card.Root>
  );
}

export interface AnalyticsDashboardProps extends StyleOverrideProps {}

/**
 * AnalyticsDashboard — three-band analytics screen powered by UI SDK Chart
 * primitives: active-sessions multi-series line chart and KPI sparkline tiles,
 * audience distribution category bars, and supporting top-routes and
 * top-interactions engagement tables.
 */
export function AnalyticsDashboard({ palette, style }: AnalyticsDashboardProps) {
  const queue = useMemo(() => Toast.createToaster(), []);

  return (
    <div {...stylex.props(styles.root, palette, style)}>
      <VStack render={<main />} gap="6" style={styles.content}>
        <VisuallyHidden render={<h1 />}>Dashboard</VisuallyHidden>

        {/* Band 1: Active sessions chart + KPI cards */}
        <VStack render={<section />} gap="3">
          <HStack justify="between" align="center" gap="3">
            <Heading render={<h2 />} size="lg" style={styles.sectionHeading}>
              Active sessions
            </Heading>
            <Button
              variant="surface"
              size="sm"
              onClick={() => queue.info("Demo: session telemetry would refresh here")}
            >
              <RefreshIcon />
              Refresh
            </Button>
          </HStack>

          <LineChart
            data={ACTIVE_SESSIONS_CHART_DATA}
            index="label"
            categories={["Total Sessions", "Web", "Mobile"]}
            colors={["blue", "orange", "violet"]}
            height={280}
            curve="linear"
            ariaLabel="Active sessions over the last 24 hours across Total Sessions, Web, and Mobile"
          />
        </VStack>

        <Grid render={<section aria-label="Headline metrics" />} columns="autoFit" gap="4">
          {METRICS.map((metric) => (
            <Card.Root key={metric.label} variant="outline">
              <VStack gap="2" style={styles.metricBody}>
                <Stat.Root size="md">
                  <Stat.Label>{metric.label}</Stat.Label>
                  <HStack align="baseline" wrap="wrap" gap="2">
                    <Stat.ValueText>{metric.value}</Stat.ValueText>
                    <HStack render={<span />} align="center" gap="0.5">
                      <Text
                        render={<span />}
                        size="sm"
                        weight="medium"
                        tone={metric.positive ? "success" : "error"}
                        style={styles.deltaIcon}
                      >
                        {metric.positive ? <ArrowUpIcon /> : <ArrowDownIcon />}
                      </Text>
                      <Text render={<span />} size="sm" weight="medium" tone="muted" tabular="true">
                        {metric.change}
                      </Text>
                    </HStack>
                  </HStack>
                  <Stat.HelpText>Last 14 days vs. prior period</Stat.HelpText>
                </Stat.Root>
                <Sparkline
                  data={metric.sparklineData}
                  index="day"
                  categories={["value"]}
                  colors={["blue"]}
                  height={40}
                  curve="linear"
                  ariaLabel={`${metric.label} 30-day trend`}
                  style={styles.sparklineHost}
                />
              </VStack>
            </Card.Root>
          ))}
        </Grid>

        <Separator />

        {/* Band 2: Audience */}
        <HStack justify="between" align="center" gap="3">
          <Heading render={<h2 />} size="lg" style={styles.sectionHeading}>
            Audience
          </Heading>
          <Button
            variant="surface"
            size="sm"
            onClick={() => queue.info("Demo: full audience breakdown would open here")}
          >
            View more
          </Button>
        </HStack>

        <Grid render={<section aria-label="Audience breakdown" />} gap="4" style={styles.twoColGrid}>
          <AudienceDistributionCard title="Geography" data={GEOGRAPHY_DATA} />
          <AudienceDistributionCard title="Discipline" data={DISCIPLINE_DATA} />
        </Grid>

        <Separator />

        {/* Band 3: Activity tables */}
        <HStack justify="between" align="center" gap="3">
          <Heading render={<h2 />} size="lg" style={styles.sectionHeading}>
            Activity
          </Heading>
          <Button
            variant="surface"
            size="sm"
            onClick={() => queue.info("Demo: full activity report would open here")}
          >
            View more
          </Button>
        </HStack>

        <Grid render={<section aria-label="Activity tables" />} gap="4" style={styles.twoColGrid}>
          <Card.Root variant="outline">
            <VStack gap="4" style={styles.cardInner}>
              <HStack justify="between" align="center" gap="2">
                <Heading render={<h3 />} size="sm" style={styles.sectionHeading}>
                  Top routes
                </Heading>
                <Link
                  href="#top-routes"
                  onClick={(e) => {
                    e.preventDefault();
                    queue.info("Demo: all routes view would open here");
                  }}
                >
                  All routes
                </Link>
              </HStack>
              <div {...stylex.props(styles.tableScroll)}>
                <Table.Root size="sm">
                  <Table.Header>
                    <Table.Row>
                      <Table.ColumnHeader>Route</Table.ColumnHeader>
                      <Table.ColumnHeader>Views</Table.ColumnHeader>
                      <Table.ColumnHeader>New Visitors</Table.ColumnHeader>
                      <Table.ColumnHeader>Median Time</Table.ColumnHeader>
                    </Table.Row>
                  </Table.Header>
                  <Table.Body>
                    {TOP_ROUTES.map((row) => (
                      <Table.Row key={row.id}>
                        <Table.Cell>
                          <Text render={<span />} variant="mono" size="xs">
                            {row.route}
                          </Text>
                        </Table.Cell>
                        <Table.Cell>
                          <VStack gap="1" style={styles.progressCell}>
                            <Progress.Root
                              value={row.views}
                              max={MAX_ROUTE_VIEWS}
                              size="xs"
                              palette={bluePalette}
                              aria-label={`${row.route} views`}
                            >
                              <Progress.Track>
                                <Progress.Range />
                              </Progress.Track>
                            </Progress.Root>
                            <Text render={<span />} size="xs" tone="muted" tabular="true">
                              {row.views.toLocaleString()} views
                            </Text>
                          </VStack>
                        </Table.Cell>
                        <Table.Cell>{row.newUsers}</Table.Cell>
                        <Table.Cell>{row.avgTime}</Table.Cell>
                      </Table.Row>
                    ))}
                  </Table.Body>
                </Table.Root>
              </div>
            </VStack>
          </Card.Root>

          <Card.Root variant="outline">
            <VStack gap="4" style={styles.cardInner}>
              <HStack justify="between" align="center" gap="2">
                <Heading render={<h3 />} size="sm" style={styles.sectionHeading}>
                  Top interactions
                </Heading>
                <Link
                  href="#top-interactions"
                  onClick={(e) => {
                    e.preventDefault();
                    queue.info("Demo: all interactions view would open here");
                  }}
                >
                  All interactions
                </Link>
              </HStack>
              <div {...stylex.props(styles.tableScroll)}>
                <Table.Root size="sm">
                  <Table.Header>
                    <Table.Row>
                      <Table.ColumnHeader>Interaction</Table.ColumnHeader>
                      <Table.ColumnHeader>Count</Table.ColumnHeader>
                      <Table.ColumnHeader>Users</Table.ColumnHeader>
                      <Table.ColumnHeader>New Users</Table.ColumnHeader>
                    </Table.Row>
                  </Table.Header>
                  <Table.Body>
                    {TOP_INTERACTIONS.map((row) => (
                      <Table.Row key={row.id}>
                        <Table.Cell>
                          <Text render={<span />} variant="mono" size="xs">
                            {row.event}
                          </Text>
                        </Table.Cell>
                        <Table.Cell>
                          <VStack gap="1" style={styles.progressCell}>
                            <Progress.Root
                              value={row.count}
                              max={MAX_INTERACTION_COUNT}
                              size="xs"
                              palette={bluePalette}
                              aria-label={`${row.event} count`}
                            >
                              <Progress.Track>
                                <Progress.Range />
                              </Progress.Track>
                            </Progress.Root>
                            <Text render={<span />} size="xs" tone="muted" tabular="true">
                              {row.count.toLocaleString()}
                            </Text>
                          </VStack>
                        </Table.Cell>
                        <Table.Cell>{row.users.toLocaleString()}</Table.Cell>
                        <Table.Cell>{row.newUsers.toLocaleString()}</Table.Cell>
                      </Table.Row>
                    ))}
                  </Table.Body>
                </Table.Root>
              </div>
            </VStack>
          </Card.Root>
        </Grid>
      </VStack>

      <Toaster toaster={queue} />
    </div>
  );
}
```

Credit: Inspired by [Analytics Dashboard](https://astryx.atmeta.com/playground?template=dashboard) from Astryx (MIT License · Copyright (c) 2026 Meta Platforms, Inc.)
