Skip to content

Analytics dashboard ​

An analytics page with the collapsible sidebar, a report date picker, metric cards, four charts and a sortable, filterable payments table.

  • Version 1.0.0
  • Bootstrap 5.3+
  • Requires Bootstrap CSS + Bootstrap JS bundle
  • Source on GitHub

Installation ​

bash
npx bootcn add analytics-dashboard
bash
pnpm dlx bootcn add analytics-dashboard
bash
yarn dlx bootcn add analytics-dashboard
bash
bunx --bun bootcn add analytics-dashboard

The CLI also installs the design tokens and these blocks and components: sidebar, breadcrumb, date-picker, stats-cards, chart-area, chart-pie, chart-bar, chart-radial, data-table, button. It writes the page with its links already pointing at your asset folders.

Usage ​

bash
npx bootcn add analytics-dashboard

The CLI installs every component and block the page uses and writes analytics-dashboard.html to your project root (or paths.pages), with its links already pointing at your CSS and JavaScript folders. Replace the sample numbers in the chart configurations, the stats and the table rows with your data, rendered on the server.

Dark mode ​

Like the admin dashboard, the page starts in the saved theme or the system setting before the first paint, and the moon/sun button switches it (Bootcn.analyticsDashboard.setTheme). The sidebar's collapsed state is remembered separately.

Accessibility ​

  • A "Skip to content" link, then landmarks: the sidebar (<aside> and <nav>), the header with the breadcrumb, and <main> with one <h1>.
  • Every chart has a "Show data" table; the date picker, data table and sidebar keep their own keyboard support.
  • Ctrl/⌘ B collapses the sidebar; below 992px it is a drawer.

Dependencies ​

  • Bootstrap 5.3+ CSS and the JS bundle.
  • The sidebar, breadcrumb, date-picker, data-table and button components, and the stats-cards, chart-area, chart-pie, chart-bar and chart-radial blocks (with the components they use).

Source ​

The exact files the CLI installs (analytics-dashboard@1.0.0). View on GitHub · Report an issue

html
<!doctype html>
<html lang="en" data-bs-theme="light">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Analytics · Acme</title>
    <script>
      // Theme before the first paint: the saved choice, else the system setting.
      (function () {
        var theme = null;
        try {
          theme = localStorage.getItem('bootcn-theme');
        } catch (error) {
          theme = null;
        }
        if (theme !== 'dark' && theme !== 'light') {
          theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
        }
        document.documentElement.setAttribute('data-bs-theme', theme);
      })();
    </script>
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.9/dist/css/bootstrap.min.css"
      integrity="sha384-yEPZ7jP9S0QKiUQ0m3jjsO4ProIW7wvR9gXkI7JOGa2XVsw53Yke2bsdkBbjmmiX"
      crossorigin="anonymous"
    />
    <link rel="stylesheet" href="{{bootcn:css}}/tokens.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/avatar.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/sidebar.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/breadcrumb.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/calendar.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/button.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/input.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/label.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/date-picker.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/stats-cards.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/chart.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/card.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/chart-area.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/chart-pie.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/chart-bar.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/chart-radial.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/table.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/checkbox.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/data-table.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/analytics-dashboard.css" />
  </head>
  <body>
    <a class="visually-hidden-focusable bootcn-analytics__skip" href="#main">Skip to content</a>
    <div class="bootcn-sidenav-layout" data-bootcn-sidenav-layout>
      <aside
        class="offcanvas-lg offcanvas-start bootcn-sidenav"
        id="bootcn-sidenav"
        tabindex="-1"
        aria-label="Sidebar"
      >
        <div class="bootcn-sidenav__header">
          <svg
            class="bootcn-icon bootcn-sidenav__logo"
            width="16"
            height="16"
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="2"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            focusable="false"
          >
            <rect x="3" y="3" width="8" height="8" rx="2" />
            <rect x="13" y="13" width="8" height="8" rx="2" />
            <path d="M13 7h8M17 3v8M3 17h8" />
          </svg>
          <span class="bootcn-sidenav__label bootcn-sidenav__brand">Acme Inc.</span>
        </div>
        <nav class="bootcn-sidenav__nav" aria-label="Main">
          <ul class="bootcn-sidenav__list">
            <li>
              <a class="bootcn-sidenav__link" href="#" aria-current="page" title="Overview">
                <svg
                  class="bootcn-icon"
                  width="16"
                  height="16"
                  viewBox="0 0 24 24"
                  fill="none"
                  stroke="currentColor"
                  stroke-width="2"
                  stroke-linecap="round"
                  stroke-linejoin="round"
                  aria-hidden="true"
                  focusable="false"
                >
                  <path d="M3 11l9-8 9 8" />
                  <path d="M5 10v10h14V10" />
                </svg>
                <span class="bootcn-sidenav__label">Overview</span>
              </a>
            </li>
            <li>
              <a class="bootcn-sidenav__link" href="#" title="Analytics">
                <svg
                  class="bootcn-icon"
                  width="16"
                  height="16"
                  viewBox="0 0 24 24"
                  fill="none"
                  stroke="currentColor"
                  stroke-width="2"
                  stroke-linecap="round"
                  stroke-linejoin="round"
                  aria-hidden="true"
                  focusable="false"
                >
                  <path d="M3 13h5l2 3h4l2-3h5" />
                  <path d="M5 5h14l2 8v6H3v-6z" />
                </svg>
                <span class="bootcn-sidenav__label">Analytics</span>
              </a>
            </li>
            <li>
              <a class="bootcn-sidenav__link" href="#" title="Reports">
                <svg
                  class="bootcn-icon"
                  width="16"
                  height="16"
                  viewBox="0 0 24 24"
                  fill="none"
                  stroke="currentColor"
                  stroke-width="2"
                  stroke-linecap="round"
                  stroke-linejoin="round"
                  aria-hidden="true"
                  focusable="false"
                >
                  <path d="M4 20V10" />
                  <path d="M10 20V4" />
                  <path d="M16 20v-7" />
                  <path d="M2 20h20" />
                </svg>
                <span class="bootcn-sidenav__label">Reports</span>
              </a>
            </li>
            <li>
              <a class="bootcn-sidenav__link" href="#" title="Team">
                <svg
                  class="bootcn-icon"
                  width="16"
                  height="16"
                  viewBox="0 0 24 24"
                  fill="none"
                  stroke="currentColor"
                  stroke-width="2"
                  stroke-linecap="round"
                  stroke-linejoin="round"
                  aria-hidden="true"
                  focusable="false"
                >
                  <circle cx="9" cy="8" r="4" />
                  <path d="M2 21c0-4 3-7 7-7s7 3 7 7" />
                  <path d="M17 4a4 4 0 0 1 0 8" />
                  <path d="M22 21c0-3-2-6-5-7" />
                </svg>
                <span class="bootcn-sidenav__label">Team</span>
              </a>
            </li>
            <li>
              <a class="bootcn-sidenav__link" href="#" title="Settings">
                <svg
                  class="bootcn-icon"
                  width="16"
                  height="16"
                  viewBox="0 0 24 24"
                  fill="none"
                  stroke="currentColor"
                  stroke-width="2"
                  stroke-linecap="round"
                  stroke-linejoin="round"
                  aria-hidden="true"
                  focusable="false"
                >
                  <path d="M4 6h9" />
                  <path d="M19 6h1" />
                  <circle cx="16" cy="6" r="2" />
                  <path d="M4 18h3" />
                  <path d="M13 18h7" />
                  <circle cx="10" cy="18" r="2" />
                  <path d="M4 12h1" />
                  <path d="M11 12h9" />
                  <circle cx="8" cy="12" r="2" />
                </svg>
                <span class="bootcn-sidenav__label">Settings</span>
              </a>
            </li>
          </ul>
        </nav>
        <div class="bootcn-sidenav__footer">
          <span class="bootcn-avatar bootcn-avatar--sm" aria-hidden="true"
            ><span class="bootcn-avatar__fallback">MP</span></span
          >
          <span class="bootcn-sidenav__label">Maria Papadopoulou</span>
        </div>
      </aside>
      <div class="bootcn-sidenav-layout__main">
        <header class="bootcn-sidenav-layout__header bootcn-analytics__header">
          <button
            type="button"
            class="bootcn-sidenav__toggle"
            data-bootcn-sidenav-toggle
            aria-controls="bootcn-sidenav"
            aria-expanded="true"
          >
            <svg
              class="bootcn-icon"
              width="16"
              height="16"
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              stroke-width="2"
              stroke-linecap="round"
              stroke-linejoin="round"
              aria-hidden="true"
              focusable="false"
            >
              <rect x="3" y="3" width="18" height="18" rx="2" />
              <path d="M9 3v18" />
            </svg>
            <span class="visually-hidden">Toggle sidebar</span>
          </button>
          <span class="bootcn-analytics__divider" aria-hidden="true"></span>
          <nav aria-label="Breadcrumb">
            <ol class="breadcrumb bootcn-breadcrumb">
              <li class="breadcrumb-item"><a href="#">Dashboard</a></li>
              <li class="breadcrumb-item active" aria-current="page">Analytics</li>
            </ol>
          </nav>
          <button
            type="button"
            class="btn bootcn-button bootcn-button--ghost bootcn-button--icon bootcn-analytics__theme"
            data-bootcn-theme-toggle
            aria-pressed="false"
          >
            <span class="visually-hidden">Dark mode</span>
            <svg
              class="bootcn-icon bootcn-analytics__when-light"
              width="16"
              height="16"
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              stroke-width="2"
              stroke-linecap="round"
              stroke-linejoin="round"
              aria-hidden="true"
              focusable="false"
            >
              <path d="M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5z" />
            </svg>
            <svg
              class="bootcn-icon bootcn-analytics__when-dark"
              width="16"
              height="16"
              viewBox="0 0 24 24"
              fill="none"
              stroke="currentColor"
              stroke-width="2"
              stroke-linecap="round"
              stroke-linejoin="round"
              aria-hidden="true"
              focusable="false"
            >
              <circle cx="12" cy="12" r="4" />
              <path
                d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"
              />
            </svg>
          </button>
        </header>
        <main class="bootcn-analytics" id="main" tabindex="-1">
          <div class="bootcn-analytics__titlebar">
            <div>
              <h1 class="bootcn-analytics__title">Analytics</h1>
              <p class="bootcn-analytics__lead">
                Visitors, sources and payments for the first half of 2026.
              </p>
            </div>
            <div class="dropdown bootcn-date-picker" data-bootcn-date-picker>
              <span class="bootcn-label" id="bootcn-date-picker-label">Report date</span>
              <button
                type="button"
                class="btn bootcn-button bootcn-button--outline bootcn-date-picker__trigger"
                data-bs-toggle="dropdown"
                data-bs-auto-close="outside"
                aria-expanded="false"
                aria-haspopup="dialog"
                aria-labelledby="bootcn-date-picker-label bootcn-date-picker-text"
              >
                <svg
                  class="bootcn-icon"
                  width="16"
                  height="16"
                  viewBox="0 0 24 24"
                  fill="none"
                  stroke="currentColor"
                  stroke-width="2"
                  stroke-linecap="round"
                  stroke-linejoin="round"
                  aria-hidden="true"
                  focusable="false"
                >
                  <rect x="3" y="5" width="18" height="16" rx="2" />
                  <path d="M16 3v4M8 3v4M3 11h18" />
                </svg>
                <span id="bootcn-date-picker-text" data-bootcn-date-picker-text>Pick a date</span>
              </button>
              <div
                class="dropdown-menu bootcn-date-picker__popover"
                role="dialog"
                aria-label="Choose the report date"
              >
                <div class="bootcn-calendar" data-bootcn-calendar>
                  <div class="bootcn-calendar__header">
                    <button
                      type="button"
                      class="bootcn-calendar__nav"
                      data-bootcn-calendar-prev
                      aria-label="Previous month"
                    >
                      <svg
                        class="bootcn-icon"
                        width="16"
                        height="16"
                        viewBox="0 0 24 24"
                        fill="none"
                        stroke="currentColor"
                        stroke-width="2"
                        stroke-linecap="round"
                        stroke-linejoin="round"
                        aria-hidden="true"
                        focusable="false"
                      >
                        <path d="m15 18-6-6 6-6" />
                      </svg>
                    </button>
                    <h2
                      class="bootcn-calendar__title"
                      id="bootcn-date-picker-calendar-title"
                      aria-live="polite"
                    >
                      Calendar
                    </h2>
                    <button
                      type="button"
                      class="bootcn-calendar__nav"
                      data-bootcn-calendar-next
                      aria-label="Next month"
                    >
                      <svg
                        class="bootcn-icon"
                        width="16"
                        height="16"
                        viewBox="0 0 24 24"
                        fill="none"
                        stroke="currentColor"
                        stroke-width="2"
                        stroke-linecap="round"
                        stroke-linejoin="round"
                        aria-hidden="true"
                        focusable="false"
                      >
                        <path d="m9 18 6-6-6-6" />
                      </svg>
                    </button>
                  </div>
                  <table
                    class="bootcn-calendar__grid"
                    role="grid"
                    aria-labelledby="bootcn-date-picker-calendar-title"
                  >
                    <thead>
                      <tr></tr>
                    </thead>
                    <tbody></tbody>
                  </table>
                  <input type="hidden" name="report-date" data-bootcn-calendar-input />
                </div>
              </div>
            </div>
          </div>
          <section class="bootcn-stats" aria-labelledby="bootcn-stats-title">
            <h2 class="visually-hidden" id="bootcn-stats-title">Key metrics</h2>
            <div class="bootcn-stats__grid">
              <article class="bootcn-stats__card">
                <div class="bootcn-stats__head">
                  <h3 class="bootcn-stats__label">Revenue</h3>
                  <svg
                    class="bootcn-stats__icon"
                    width="16"
                    height="16"
                    viewBox="0 0 24 24"
                    fill="none"
                    stroke="currentColor"
                    stroke-width="2"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    aria-hidden="true"
                    focusable="false"
                  >
                    <path d="M12 3v18" />
                    <path
                      d="M17 7c-1-1.5-3-2-5-2-3 0-4 1.5-4 3s1 2.5 4 3 4 1.5 4 3-1 3-4 3c-2 0-4-.5-5-2"
                    />
                  </svg>
                </div>
                <p class="bootcn-stats__value">€45,231.89</p>
                <p class="bootcn-stats__change bootcn-stats__change--up">
                  <svg
                    class="bootcn-icon"
                    width="16"
                    height="16"
                    viewBox="0 0 24 24"
                    fill="none"
                    stroke="currentColor"
                    stroke-width="2"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    aria-hidden="true"
                    focusable="false"
                  >
                    <path d="M7 14l5-5 5 5" />
                  </svg>
                  <span>+20.1%</span> since last month
                </p>
              </article>
              <article class="bootcn-stats__card">
                <div class="bootcn-stats__head">
                  <h3 class="bootcn-stats__label">Subscriptions</h3>
                  <svg
                    class="bootcn-stats__icon"
                    width="16"
                    height="16"
                    viewBox="0 0 24 24"
                    fill="none"
                    stroke="currentColor"
                    stroke-width="2"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    aria-hidden="true"
                    focusable="false"
                  >
                    <circle cx="9" cy="8" r="4" />
                    <path d="M2 21c0-4 3-7 7-7s7 3 7 7" />
                    <path d="M17 4a4 4 0 0 1 0 8" />
                    <path d="M22 21c0-3-2-6-5-7" />
                  </svg>
                </div>
                <p class="bootcn-stats__value">2,350</p>
                <p class="bootcn-stats__change bootcn-stats__change--up">
                  <svg
                    class="bootcn-icon"
                    width="16"
                    height="16"
                    viewBox="0 0 24 24"
                    fill="none"
                    stroke="currentColor"
                    stroke-width="2"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    aria-hidden="true"
                    focusable="false"
                  >
                    <path d="M7 14l5-5 5 5" />
                  </svg>
                  <span>+180</span> since last month
                </p>
              </article>
              <article class="bootcn-stats__card">
                <div class="bootcn-stats__head">
                  <h3 class="bootcn-stats__label">Orders</h3>
                  <svg
                    class="bootcn-stats__icon"
                    width="16"
                    height="16"
                    viewBox="0 0 24 24"
                    fill="none"
                    stroke="currentColor"
                    stroke-width="2"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    aria-hidden="true"
                    focusable="false"
                  >
                    <circle cx="9" cy="20" r="1" />
                    <circle cx="18" cy="20" r="1" />
                    <path d="M2 3h3l3 12h11l2-8H6" />
                  </svg>
                </div>
                <p class="bootcn-stats__value">12,234</p>
                <p class="bootcn-stats__change bootcn-stats__change--down">
                  <svg
                    class="bootcn-icon"
                    width="16"
                    height="16"
                    viewBox="0 0 24 24"
                    fill="none"
                    stroke="currentColor"
                    stroke-width="2"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    aria-hidden="true"
                    focusable="false"
                  >
                    <path d="M7 10l5 5 5-5" />
                  </svg>
                  <span>−4.3%</span> since last month
                </p>
              </article>
              <article class="bootcn-stats__card">
                <div class="bootcn-stats__head">
                  <h3 class="bootcn-stats__label">Active now</h3>
                  <svg
                    class="bootcn-stats__icon"
                    width="16"
                    height="16"
                    viewBox="0 0 24 24"
                    fill="none"
                    stroke="currentColor"
                    stroke-width="2"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    aria-hidden="true"
                    focusable="false"
                  >
                    <path d="M3 12h4l3 8 4-16 3 8h4" />
                  </svg>
                </div>
                <p class="bootcn-stats__value">573</p>
                <p class="bootcn-stats__change bootcn-stats__change--up">
                  <svg
                    class="bootcn-icon"
                    width="16"
                    height="16"
                    viewBox="0 0 24 24"
                    fill="none"
                    stroke="currentColor"
                    stroke-width="2"
                    stroke-linecap="round"
                    stroke-linejoin="round"
                    aria-hidden="true"
                    focusable="false"
                  >
                    <path d="M7 14l5-5 5 5" />
                  </svg>
                  <span>+201</span> since last month
                </p>
              </article>
            </div>
          </section>
          <div class="bootcn-analytics__grid bootcn-analytics__grid--wide">
            <section class="card bootcn-card bootcn-chart-card" aria-labelledby="chart-area-title">
              <header class="bootcn-card__header">
                <h2 class="bootcn-card__title" id="chart-area-title">Area chart</h2>
                <p class="bootcn-card__description">
                  Visitors for the last six months, stacked by device.
                </p>
              </header>
              <div class="bootcn-card__content">
                <figure class="bootcn-chart" data-bootcn-chart>
                  <figcaption class="visually-hidden">
                    Desktop and mobile visitors per month, January to June 2026, stacked.
                  </figcaption>
                  <script type="application/json">
                    {
                      "type": "area",
                      "stacked": true,
                      "categoryLabel": "Month",
                      "categories": ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
                      "series": [
                        {
                          "name": "Mobile",
                          "data": [98, 186, 142, 171, 128, 165]
                        },
                        {
                          "name": "Desktop",
                          "data": [214, 312, 248, 96, 231, 276]
                        }
                      ]
                    }
                  </script>
                </figure>
              </div>
              <footer class="bootcn-card__footer bootcn-chart-card__footer">
                <p class="bootcn-chart-card__trend">Up 5.2% this month</p>
                <p class="bootcn-chart-card__note">January – June 2026</p>
              </footer>
            </section>
            <section class="card bootcn-card bootcn-chart-card" aria-labelledby="chart-pie-title">
              <header class="bootcn-card__header">
                <h2 class="bootcn-card__title" id="chart-pie-title">Donut chart</h2>
                <p class="bootcn-card__description">Where visitors came from this month.</p>
              </header>
              <div class="bootcn-card__content">
                <figure class="bootcn-chart" data-bootcn-chart>
                  <figcaption class="visually-hidden">
                    Visitors by traffic source, June 2026.
                  </figcaption>
                  <script type="application/json">
                    {
                      "type": "pie",
                      "donut": true,
                      "centerLabel": "Visitors",
                      "categoryLabel": "Source",
                      "categories": ["Search", "Direct", "Social", "Email", "Other"],
                      "series": [
                        {
                          "name": "Visitors",
                          "data": [275, 200, 187, 173, 90]
                        }
                      ]
                    }
                  </script>
                </figure>
              </div>
              <footer class="bootcn-card__footer bootcn-chart-card__footer">
                <p class="bootcn-chart-card__trend">Search brings 30% of visitors</p>
                <p class="bootcn-chart-card__note">June 2026</p>
              </footer>
            </section>
          </div>
          <div class="bootcn-analytics__grid">
            <section class="card bootcn-card bootcn-chart-card" aria-labelledby="chart-bar-title">
              <header class="bootcn-card__header">
                <h2 class="bootcn-card__title" id="chart-bar-title">Bar chart</h2>
                <p class="bootcn-card__description">Desktop and mobile visitors side by side.</p>
              </header>
              <div class="bootcn-card__content">
                <figure class="bootcn-chart" data-bootcn-chart>
                  <figcaption class="visually-hidden">
                    Desktop and mobile visitors per month, January to June 2026.
                  </figcaption>
                  <script type="application/json">
                    {
                      "type": "bar",
                      "categoryLabel": "Month",
                      "categories": ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
                      "series": [
                        {
                          "name": "Desktop",
                          "data": [214, 312, 248, 96, 231, 276]
                        },
                        {
                          "name": "Mobile",
                          "data": [98, 186, 142, 171, 128, 165]
                        }
                      ]
                    }
                  </script>
                </figure>
              </div>
              <footer class="bootcn-card__footer bootcn-chart-card__footer">
                <p class="bootcn-chart-card__trend">Up 5.2% this month</p>
                <p class="bootcn-chart-card__note">January – June 2026</p>
              </footer>
            </section>
            <section
              class="card bootcn-card bootcn-chart-card"
              aria-labelledby="chart-radial-title"
            >
              <header class="bootcn-card__header">
                <h2 class="bootcn-card__title" id="chart-radial-title">Radial chart</h2>
                <p class="bootcn-card__description">Share of visitors by browser.</p>
              </header>
              <div class="bootcn-card__content">
                <figure class="bootcn-chart" data-bootcn-chart>
                  <figcaption class="visually-hidden">Visitors by browser, June 2026.</figcaption>
                  <script type="application/json">
                    {
                      "type": "radial",
                      "max": 300,
                      "categoryLabel": "Browser",
                      "categories": ["Chrome", "Safari", "Firefox", "Edge", "Other"],
                      "series": [
                        {
                          "name": "Visitors",
                          "data": [275, 200, 187, 173, 90]
                        }
                      ]
                    }
                  </script>
                </figure>
              </div>
              <footer class="bootcn-card__footer bootcn-chart-card__footer">
                <p class="bootcn-chart-card__trend">Chrome leads with 30%</p>
                <p class="bootcn-chart-card__note">June 2026</p>
              </footer>
            </section>
          </div>
          <section
            class="card bootcn-card bootcn-analytics__payments"
            aria-labelledby="bootcn-analytics-payments-title"
          >
            <header class="bootcn-card__header">
              <h2 class="bootcn-card__title" id="bootcn-analytics-payments-title">
                Recent payments
              </h2>
              <p class="bootcn-card__description">Sort, filter and select payments.</p>
            </header>
            <div class="bootcn-card__content">
              <div class="bootcn-data-table" data-bootcn-data-table data-page-size="5">
                <div class="bootcn-data-table__toolbar">
                  <label class="visually-hidden" for="bootcn-data-table-filter"
                    >Filter payments</label
                  >
                  <input
                    class="form-control bootcn-input bootcn-data-table__filter"
                    id="bootcn-data-table-filter"
                    type="search"
                    placeholder="Filter payments…"
                    data-bootcn-data-table-filter
                  />
                </div>
                <div class="table-responsive">
                  <table class="table bootcn-table">
                    <caption class="visually-hidden">
                      Payments
                    </caption>
                    <thead>
                      <tr>
                        <th scope="col" class="bootcn-data-table__check">
                          <input
                            class="form-check-input"
                            type="checkbox"
                            aria-label="Select all rows"
                            data-bootcn-data-table-select-all
                          />
                        </th>
                        <th scope="col" aria-sort="none">
                          <button
                            type="button"
                            class="bootcn-data-table__sort"
                            data-bootcn-data-table-sort="1"
                          >
                            Status
                            <svg
                              class="bootcn-icon"
                              width="16"
                              height="16"
                              viewBox="0 0 24 24"
                              fill="none"
                              stroke="currentColor"
                              stroke-width="2"
                              stroke-linecap="round"
                              stroke-linejoin="round"
                              aria-hidden="true"
                              focusable="false"
                            >
                              <path d="m7 15 5 5 5-5" />
                              <path d="m7 9 5-5 5 5" />
                            </svg>
                          </button>
                        </th>
                        <th scope="col" aria-sort="none">
                          <button
                            type="button"
                            class="bootcn-data-table__sort"
                            data-bootcn-data-table-sort="2"
                          >
                            Email
                            <svg
                              class="bootcn-icon"
                              width="16"
                              height="16"
                              viewBox="0 0 24 24"
                              fill="none"
                              stroke="currentColor"
                              stroke-width="2"
                              stroke-linecap="round"
                              stroke-linejoin="round"
                              aria-hidden="true"
                              focusable="false"
                            >
                              <path d="m7 15 5 5 5-5" />
                              <path d="m7 9 5-5 5 5" />
                            </svg>
                          </button>
                        </th>
                        <th scope="col" aria-sort="none" class="text-end">
                          <button
                            type="button"
                            class="bootcn-data-table__sort"
                            data-bootcn-data-table-sort="3"
                            data-type="number"
                          >
                            Amount
                            <svg
                              class="bootcn-icon"
                              width="16"
                              height="16"
                              viewBox="0 0 24 24"
                              fill="none"
                              stroke="currentColor"
                              stroke-width="2"
                              stroke-linecap="round"
                              stroke-linejoin="round"
                              aria-hidden="true"
                              focusable="false"
                            >
                              <path d="m7 15 5 5 5-5" />
                              <path d="m7 9 5-5 5 5" />
                            </svg>
                          </button>
                        </th>
                      </tr>
                    </thead>
                    <tbody>
                      <tr>
                        <td class="bootcn-data-table__check">
                          <input
                            class="form-check-input"
                            type="checkbox"
                            aria-label="Select ken99@example.com"
                            data-bootcn-data-table-select
                          />
                        </td>
                        <td>Success</td>
                        <td>ken99@example.com</td>
                        <td class="text-end" data-value="316">€316.00</td>
                      </tr>
                      <tr>
                        <td class="bootcn-data-table__check">
                          <input
                            class="form-check-input"
                            type="checkbox"
                            aria-label="Select abe45@example.com"
                            data-bootcn-data-table-select
                          />
                        </td>
                        <td>Success</td>
                        <td>abe45@example.com</td>
                        <td class="text-end" data-value="242">€242.00</td>
                      </tr>
                      <tr>
                        <td class="bootcn-data-table__check">
                          <input
                            class="form-check-input"
                            type="checkbox"
                            aria-label="Select monserrat44@example.com"
                            data-bootcn-data-table-select
                          />
                        </td>
                        <td>Processing</td>
                        <td>monserrat44@example.com</td>
                        <td class="text-end" data-value="837">€837.00</td>
                      </tr>
                      <tr>
                        <td class="bootcn-data-table__check">
                          <input
                            class="form-check-input"
                            type="checkbox"
                            aria-label="Select carmella@example.com"
                            data-bootcn-data-table-select
                          />
                        </td>
                        <td>Failed</td>
                        <td>carmella@example.com</td>
                        <td class="text-end" data-value="721">€721.00</td>
                      </tr>
                      <tr>
                        <td class="bootcn-data-table__check">
                          <input
                            class="form-check-input"
                            type="checkbox"
                            aria-label="Select jason78@example.com"
                            data-bootcn-data-table-select
                          />
                        </td>
                        <td>Pending</td>
                        <td>jason78@example.com</td>
                        <td class="text-end" data-value="450">€450.00</td>
                      </tr>
                      <tr>
                        <td class="bootcn-data-table__check">
                          <input
                            class="form-check-input"
                            type="checkbox"
                            aria-label="Select sarah23@example.com"
                            data-bootcn-data-table-select
                          />
                        </td>
                        <td>Success</td>
                        <td>sarah23@example.com</td>
                        <td class="text-end" data-value="125">€125.00</td>
                      </tr>
                      <tr>
                        <td class="bootcn-data-table__check">
                          <input
                            class="form-check-input"
                            type="checkbox"
                            aria-label="Select lucas.p@example.com"
                            data-bootcn-data-table-select
                          />
                        </td>
                        <td>Failed</td>
                        <td>lucas.p@example.com</td>
                        <td class="text-end" data-value="980">€980.00</td>
                      </tr>
                      <tr>
                        <td class="bootcn-data-table__check">
                          <input
                            class="form-check-input"
                            type="checkbox"
                            aria-label="Select emma.w@example.com"
                            data-bootcn-data-table-select
                          />
                        </td>
                        <td>Processing</td>
                        <td>emma.w@example.com</td>
                        <td class="text-end" data-value="315">€315.00</td>
                      </tr>
                      <tr>
                        <td class="bootcn-data-table__check">
                          <input
                            class="form-check-input"
                            type="checkbox"
                            aria-label="Select noah.b@example.com"
                            data-bootcn-data-table-select
                          />
                        </td>
                        <td>Success</td>
                        <td>noah.b@example.com</td>
                        <td class="text-end" data-value="74">€74.00</td>
                      </tr>
                      <tr>
                        <td class="bootcn-data-table__check">
                          <input
                            class="form-check-input"
                            type="checkbox"
                            aria-label="Select olivia.k@example.com"
                            data-bootcn-data-table-select
                          />
                        </td>
                        <td>Pending</td>
                        <td>olivia.k@example.com</td>
                        <td class="text-end" data-value="562">€562.00</td>
                      </tr>
                      <tr>
                        <td class="bootcn-data-table__check">
                          <input
                            class="form-check-input"
                            type="checkbox"
                            aria-label="Select liam.m@example.com"
                            data-bootcn-data-table-select
                          />
                        </td>
                        <td>Success</td>
                        <td>liam.m@example.com</td>
                        <td class="text-end" data-value="199">€199.00</td>
                      </tr>
                      <tr>
                        <td class="bootcn-data-table__check">
                          <input
                            class="form-check-input"
                            type="checkbox"
                            aria-label="Select ava.r@example.com"
                            data-bootcn-data-table-select
                          />
                        </td>
                        <td>Failed</td>
                        <td>ava.r@example.com</td>
                        <td class="text-end" data-value="640">€640.00</td>
                      </tr>
                    </tbody>
                  </table>
                </div>
                <p class="bootcn-data-table__empty" hidden>No payments match.</p>
                <div class="bootcn-data-table__footer">
                  <p class="bootcn-data-table__status" data-bootcn-data-table-selection>
                    0 of 12 rows selected.
                  </p>
                  <p class="bootcn-data-table__status" data-bootcn-data-table-status role="status">
                    Showing 1–5 of 12
                  </p>
                  <div class="bootcn-data-table__pages">
                    <button
                      type="button"
                      class="btn bootcn-button bootcn-button--outline bootcn-button--sm"
                      data-bootcn-data-table-prev
                    >
                      Previous
                    </button>
                    <button
                      type="button"
                      class="btn bootcn-button bootcn-button--outline bootcn-button--sm"
                      data-bootcn-data-table-next
                    >
                      Next
                    </button>
                  </div>
                </div>
              </div>
            </div>
          </section>
        </main>
      </div>
    </div>
    <script
      src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.9/dist/js/bootstrap.bundle.min.js"
      integrity="sha384-WyOxWvTyr1QaMPfiPJSv76iReVthorl5uWlFtZPyK0IEB0hGzo9y5Bp9mYanr8Bu"
      crossorigin="anonymous"
    ></script>
    <script src="{{bootcn:js}}/sidebar.js"></script>
    <script src="{{bootcn:js}}/calendar.js"></script>
    <script src="{{bootcn:js}}/date-picker.js"></script>
    <script src="{{bootcn:js}}/chart.js"></script>
    <script src="{{bootcn:js}}/data-table.js"></script>
    <script src="{{bootcn:js}}/analytics-dashboard.js"></script>
  </body>
</html>
css
/*
 * Analytics dashboard layout. The Sidebar component provides the shell
 * (collapsible on desktop, a drawer on phones); blocks bring their own CSS.
 */
.bootcn-analytics__skip {
  position: absolute;
  z-index: 1080;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--bootcn-radius);
  background-color: var(--bootcn-background);
  box-shadow: var(--bootcn-focus-ring);
}

.bootcn-analytics__header {
  position: sticky;
  z-index: 1020;
  top: 0;
  background-color: var(--bootcn-background);
}

.bootcn-analytics__divider {
  width: 1px;
  height: 1rem;
  background-color: var(--bootcn-border-color);
}

.bootcn-analytics__theme {
  margin-left: auto;
}

[data-bs-theme='dark'] .bootcn-analytics__when-light,
[data-bs-theme='light'] .bootcn-analytics__when-dark {
  display: none;
}

.bootcn-analytics {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 1rem 3rem;
  outline: 0;
}

@media (min-width: 768px) {
  .bootcn-analytics {
    padding-inline: 2rem;
  }
}

.bootcn-analytics__titlebar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.bootcn-analytics__title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.bootcn-analytics__lead {
  margin: 0.25rem 0 0;
  color: var(--bootcn-muted-foreground);
}

.bootcn-analytics__grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 1200px) {
  .bootcn-analytics__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bootcn-analytics__grid--wide {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }
}
js
/*
 * Analytics dashboard: the dark mode toggle. The theme is set before the first
 * paint by the inline script in <head>; this keeps the toggle in sync, saves
 * the choice, and follows the system setting until the user picks one.
 */
(function () {
  'use strict';

  var STORAGE_KEY = 'bootcn-theme';
  var TOGGLE = '[data-bootcn-theme-toggle]';
  var root = document.documentElement;
  var media = window.matchMedia('(prefers-color-scheme: dark)');
  var observer = null;
  var initialized = false;

  function current() {
    return root.getAttribute('data-bs-theme') === 'dark' ? 'dark' : 'light';
  }

  function saved() {
    try {
      return localStorage.getItem(STORAGE_KEY);
    } catch {
      return null;
    }
  }

  function syncToggles() {
    var pressed = String(current() === 'dark');
    document.querySelectorAll(TOGGLE).forEach(function (button) {
      button.setAttribute('aria-pressed', pressed);
    });
  }

  function setTheme(theme, remember) {
    root.setAttribute('data-bs-theme', theme);
    if (remember) {
      try {
        localStorage.setItem(STORAGE_KEY, theme);
      } catch {
        // Storage unavailable (private mode): the choice lasts for this page only.
      }
    }
  }

  function onClick(event) {
    var button = event.target.closest(TOGGLE);
    if (!button) return;
    setTheme(current() === 'dark' ? 'light' : 'dark', true);
  }

  function onSystemChange(event) {
    if (saved() === null) setTheme(event.matches ? 'dark' : 'light', false);
  }

  function init() {
    if (initialized) return;
    initialized = true;
    document.addEventListener('click', onClick);
    media.addEventListener('change', onSystemChange);
    // Keep aria-pressed right whoever changes the theme.
    observer = new MutationObserver(syncToggles);
    observer.observe(root, { attributes: true, attributeFilter: ['data-bs-theme'] });
    syncToggles();
  }

  function destroy() {
    if (!initialized) return;
    initialized = false;
    document.removeEventListener('click', onClick);
    media.removeEventListener('change', onSystemChange);
    if (observer) observer.disconnect();
    observer = null;
  }

  window.Bootcn = window.Bootcn || {};
  window.Bootcn.analyticsDashboard = { init: init, destroy: destroy, setTheme: setTheme };

  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', init);
  } else {
    init();
  }
})();

Released under the MIT License. Not affiliated with Bootstrap or shadcn/ui.