Skip to content

Admin dashboard ​

A complete admin page: responsive sidebar, top bar with search, theme toggle and user menu, metric cards, a revenue chart, recent activity and a transactions table.

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

Installation ​

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

The CLI also installs the design tokens and these blocks and components: app-sidebar, user-menu, page-header, stats-cards, activity-feed, transactions-table. It writes the page with its links already pointing at your asset folders.

Usage ​

bash
npx bootcn add admin-dashboard

The CLI installs every block and component the page uses, then writes admin-dashboard.html to your project root (or to paths.pages in bootcn.json, which is public/ for PHP projects with a public/ folder). Open it in a browser: it already links its stylesheets and scripts.

The page refers to your asset folders with placeholders such as {{bootcn:css}}; the CLI replaces them with the right relative paths for your bootcn.json, so the links work wherever your CSS and JavaScript live. If you copy the page by hand, replace them yourself (for example with assets/css).

To use it in PHP, rename the file to .php and move the sidebar and top bar into your layout's header include. Replace the sample numbers, people and transactions with your data.

Dark mode ​

The page starts in the theme the user picked last (saved in localStorage under bootcn-theme), or else the system setting, before the first paint. The moon/sun button in the top bar switches theme. admin-dashboard.js exposes Bootcn.adminDashboard.setTheme('dark' | 'light', remember).

Accessibility ​

  • A "Skip to content" link is the first focusable element.
  • Landmarks: the sidebar (<aside> with a <nav>), the top bar (<header>) and <main>. The page has one <h1> and <h2>s for each section.
  • The theme toggle is a button with aria-pressed; its name is "Dark mode".
  • The chart is decorative; the same numbers are in a visually hidden table.
  • Below 992px the sidebar becomes a drawer that traps focus and closes with Escape.

Dependencies ​

  • Bootstrap 5.3+ CSS and the JS bundle.
  • The app-sidebar, user-menu, page-header, stats-cards, activity-feed and transactions-table blocks, and the components they use.

Source ​

The exact files the CLI installs (admin-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>Dashboard · 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}}/button.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/badge.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/avatar.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/card.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/input.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/dropdown.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/user-menu.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/app-sidebar.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/page-header.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/stats-cards.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/activity-feed.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/transactions-table.css" />
    <link rel="stylesheet" href="{{bootcn:css}}/admin-dashboard.css" />
  </head>
  <body class="bootcn-admin">
    <a class="visually-hidden-focusable bootcn-admin__skip" href="#main">Skip to content</a>
    <div class="bootcn-admin__layout">
      <aside
        class="offcanvas-lg offcanvas-start bootcn-sidebar"
        tabindex="-1"
        id="bootcn-sidebar"
        aria-label="Sidebar"
      >
        <div class="offcanvas-header bootcn-sidebar__header">
          <p class="offcanvas-title bootcn-sidebar__brand">
            <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="8" height="8" rx="2" />
              <rect x="13" y="13" width="8" height="8" rx="2" />
              <path d="M13 7h8M17 3v8M3 17h8" />
            </svg>
            Acme
          </p>
          <button
            type="button"
            class="btn-close"
            data-bs-dismiss="offcanvas"
            data-bs-target="#bootcn-sidebar"
            aria-label="Close menu"
          ></button>
        </div>
        <div class="offcanvas-body bootcn-sidebar__body">
          <a class="bootcn-sidebar__brand d-none d-lg-flex" href="#">
            <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="8" height="8" rx="2" />
              <rect x="13" y="13" width="8" height="8" rx="2" />
              <path d="M13 7h8M17 3v8M3 17h8" />
            </svg>
            Acme
          </a>
          <nav class="bootcn-sidebar__nav" aria-label="Main">
            <p class="bootcn-sidebar__heading" id="bootcn-sidebar-workspace">Workspace</p>
            <ul class="bootcn-sidebar__list" aria-labelledby="bootcn-sidebar-workspace">
              <li>
                <a class="bootcn-sidebar__link" href="#" aria-current="page">
                  <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>Dashboard</span>
                </a>
              </li>
              <li>
                <a class="bootcn-sidebar__link" href="#">
                  <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 6h6l2 2h10v11H3z" />
                  </svg>
                  <span>Projects</span>
                </a>
              </li>
              <li>
                <a class="bootcn-sidebar__link" href="#">
                  <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>Inbox</span>
                  <span class="badge bootcn-badge bootcn-badge--secondary bootcn-sidebar__count"
                    >4<span class="visually-hidden"> unread</span></span
                  >
                </a>
              </li>
              <li>
                <a class="bootcn-sidebar__link" href="#">
                  <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>Reports</span>
                </a>
              </li>
            </ul>
            <p class="bootcn-sidebar__heading" id="bootcn-sidebar-account">Account</p>
            <ul class="bootcn-sidebar__list" aria-labelledby="bootcn-sidebar-account">
              <li>
                <a class="bootcn-sidebar__link" href="#">
                  <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>Team</span>
                </a>
              </li>
              <li>
                <a class="bootcn-sidebar__link" href="#">
                  <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>Settings</span>
                </a>
              </li>
              <li>
                <a class="bootcn-sidebar__link" href="#">
                  <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="12" cy="12" r="9" />
                    <path d="M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.7" />
                    <path d="M12 17h.01" />
                  </svg>
                  <span>Help</span>
                </a>
              </li>
            </ul>
          </nav>
          <div class="bootcn-sidebar__user">
            <span class="bootcn-avatar bootcn-avatar--sm" aria-hidden="true"
              ><span class="bootcn-avatar__fallback">MP</span></span
            >
            <div class="bootcn-sidebar__user-text">
              <span class="bootcn-sidebar__user-name">Maria Papadopoulou</span>
              <span class="bootcn-sidebar__user-email">maria@example.com</span>
            </div>
          </div>
        </div>
      </aside>
      <div class="bootcn-admin__main">
        <header class="bootcn-admin__topbar">
          <button
            class="btn bootcn-button bootcn-button--outline bootcn-button--sm d-lg-none bootcn-sidebar__open"
            type="button"
            data-bs-toggle="offcanvas"
            data-bs-target="#bootcn-sidebar"
            aria-controls="bootcn-sidebar"
          >
            <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 6h16M4 12h16M4 18h16" />
            </svg>
            Menu
          </button>
          <form class="bootcn-admin__search" role="search" aria-label="Site" action="#">
            <label class="visually-hidden" for="bootcn-admin-search">Search</label>
            <input
              class="form-control bootcn-input"
              type="search"
              id="bootcn-admin-search"
              name="q"
              placeholder="Search…"
            />
            <button type="submit" class="visually-hidden">Search</button>
          </form>
          <div class="bootcn-admin__topbar-end">
            <button
              type="button"
              class="btn bootcn-button bootcn-button--ghost bootcn-button--icon"
              data-bootcn-theme-toggle
              aria-pressed="false"
            >
              <span class="visually-hidden">Dark mode</span>
              <svg
                class="bootcn-icon bootcn-admin__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-admin__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>
            <div class="dropdown bootcn-dropdown bootcn-user-menu">
              <button
                class="btn bootcn-user-menu__trigger"
                type="button"
                id="bootcn-admin-user-trigger"
                data-bs-toggle="dropdown"
                aria-expanded="false"
              >
                <span class="bootcn-avatar bootcn-avatar--sm" aria-hidden="true"
                  ><span class="bootcn-avatar__fallback">MP</span></span
                >
                <span class="bootcn-user-menu__name">Maria Papadopoulou</span>
                <svg
                  class="bootcn-user-menu__chevron"
                  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="M6 9l6 6 6-6" />
                </svg>
              </button>
              <ul
                class="dropdown-menu dropdown-menu-end bootcn-dropdown__menu"
                aria-labelledby="bootcn-admin-user-trigger"
              >
                <li>
                  <p class="dropdown-header bootcn-user-menu__header">
                    <span class="bootcn-user-menu__header-name">Maria Papadopoulou</span>
                    <span class="bootcn-user-menu__email">maria@example.com</span>
                  </p>
                </li>
                <li><hr class="dropdown-divider bootcn-dropdown__divider" /></li>
                <li><a class="dropdown-item bootcn-dropdown__item" href="#profile">Profile</a></li>
                <li><a class="dropdown-item bootcn-dropdown__item" href="#billing">Billing</a></li>
                <li>
                  <a class="dropdown-item bootcn-dropdown__item" href="#settings">Settings</a>
                </li>
                <li><hr class="dropdown-divider bootcn-dropdown__divider" /></li>
                <li>
                  <button
                    class="dropdown-item bootcn-dropdown__item bootcn-dropdown__item--destructive"
                    type="button"
                  >
                    Sign out
                  </button>
                </li>
              </ul>
            </div>
          </div>
        </header>
        <main class="bootcn-admin__content" id="main" tabindex="-1">
          <header class="bootcn-page-header">
            <nav aria-label="Breadcrumb">
              <ol class="breadcrumb bootcn-page-header__breadcrumb">
                <li class="breadcrumb-item"><a href="#">Home</a></li>
                <li class="breadcrumb-item active" aria-current="page">Dashboard</li>
              </ol>
            </nav>
            <div class="bootcn-page-header__row">
              <div class="bootcn-page-header__text">
                <h1 class="bootcn-page-header__title">Dashboard</h1>
                <p class="bootcn-page-header__description">
                  How your workspace is doing this month.
                </p>
              </div>
              <div class="bootcn-page-header__actions">
                <button type="button" class="btn bootcn-button bootcn-button--outline">
                  <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="M12 4v12" />
                    <path d="M7 11l5 5 5-5" />
                    <path d="M5 20h14" />
                  </svg>
                  Download
                </button>
                <button type="button" class="btn bootcn-button bootcn-button--default">
                  <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="M12 5v14M5 12h14" />
                  </svg>
                  New report
                </button>
              </div>
            </div>
          </header>
          <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-admin__grid">
            <section
              class="card bootcn-card bootcn-admin__chart"
              aria-labelledby="bootcn-admin-chart-title"
            >
              <header class="bootcn-card__header">
                <h2 class="bootcn-card__title" id="bootcn-admin-chart-title">Revenue</h2>
                <p class="bootcn-card__description">
                  Monthly revenue in 2026, in thousands of euros.
                </p>
              </header>
              <div class="bootcn-card__content">
                <div class="bootcn-bar-chart" aria-hidden="true">
                  <div class="bootcn-bar-chart__col">
                    <span class="bootcn-bar-chart__bar" style="--bootcn-bar-value: 0.48"></span>
                    <span class="bootcn-bar-chart__label">Jan</span>
                  </div>
                  <div class="bootcn-bar-chart__col">
                    <span class="bootcn-bar-chart__bar" style="--bootcn-bar-value: 0.56"></span>
                    <span class="bootcn-bar-chart__label">Feb</span>
                  </div>
                  <div class="bootcn-bar-chart__col">
                    <span class="bootcn-bar-chart__bar" style="--bootcn-bar-value: 0.52"></span>
                    <span class="bootcn-bar-chart__label">Mar</span>
                  </div>
                  <div class="bootcn-bar-chart__col">
                    <span class="bootcn-bar-chart__bar" style="--bootcn-bar-value: 0.65"></span>
                    <span class="bootcn-bar-chart__label">Apr</span>
                  </div>
                  <div class="bootcn-bar-chart__col">
                    <span class="bootcn-bar-chart__bar" style="--bootcn-bar-value: 0.71"></span>
                    <span class="bootcn-bar-chart__label">May</span>
                  </div>
                  <div class="bootcn-bar-chart__col">
                    <span class="bootcn-bar-chart__bar" style="--bootcn-bar-value: 0.66"></span>
                    <span class="bootcn-bar-chart__label">Jun</span>
                  </div>
                  <div class="bootcn-bar-chart__col">
                    <span class="bootcn-bar-chart__bar" style="--bootcn-bar-value: 0.78"></span>
                    <span class="bootcn-bar-chart__label">Jul</span>
                  </div>
                  <div class="bootcn-bar-chart__col">
                    <span class="bootcn-bar-chart__bar" style="--bootcn-bar-value: 0.82"></span>
                    <span class="bootcn-bar-chart__label">Aug</span>
                  </div>
                  <div class="bootcn-bar-chart__col">
                    <span class="bootcn-bar-chart__bar" style="--bootcn-bar-value: 0.75"></span>
                    <span class="bootcn-bar-chart__label">Sep</span>
                  </div>
                  <div class="bootcn-bar-chart__col">
                    <span class="bootcn-bar-chart__bar" style="--bootcn-bar-value: 0.89"></span>
                    <span class="bootcn-bar-chart__label">Oct</span>
                  </div>
                  <div class="bootcn-bar-chart__col">
                    <span class="bootcn-bar-chart__bar" style="--bootcn-bar-value: 0.96"></span>
                    <span class="bootcn-bar-chart__label">Nov</span>
                  </div>
                  <div class="bootcn-bar-chart__col">
                    <span class="bootcn-bar-chart__bar" style="--bootcn-bar-value: 1"></span>
                    <span class="bootcn-bar-chart__label">Dec</span>
                  </div>
                </div>
                <table class="visually-hidden">
                  <caption>
                    Monthly revenue in 2026
                  </caption>
                  <thead>
                    <tr>
                      <th scope="col">Month</th>
                      <th scope="col">Revenue</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr>
                      <th scope="row">Jan</th>
                      <td>€18.2k</td>
                    </tr>
                    <tr>
                      <th scope="row">Feb</th>
                      <td>€21.4k</td>
                    </tr>
                    <tr>
                      <th scope="row">Mar</th>
                      <td>€19.8k</td>
                    </tr>
                    <tr>
                      <th scope="row">Apr</th>
                      <td>€24.6k</td>
                    </tr>
                    <tr>
                      <th scope="row">May</th>
                      <td>€27.1k</td>
                    </tr>
                    <tr>
                      <th scope="row">Jun</th>
                      <td>€25.3k</td>
                    </tr>
                    <tr>
                      <th scope="row">Jul</th>
                      <td>€29.8k</td>
                    </tr>
                    <tr>
                      <th scope="row">Aug</th>
                      <td>€31.2k</td>
                    </tr>
                    <tr>
                      <th scope="row">Sep</th>
                      <td>€28.4k</td>
                    </tr>
                    <tr>
                      <th scope="row">Oct</th>
                      <td>€33.9k</td>
                    </tr>
                    <tr>
                      <th scope="row">Nov</th>
                      <td>€36.5k</td>
                    </tr>
                    <tr>
                      <th scope="row">Dec</th>
                      <td>€38.1k</td>
                    </tr>
                  </tbody>
                </table>
              </div>
            </section>
            <section
              class="card bootcn-card bootcn-activity"
              aria-labelledby="bootcn-activity-title"
            >
              <header class="bootcn-card__header">
                <h2 class="bootcn-card__title" id="bootcn-activity-title">Recent activity</h2>
                <p class="bootcn-card__description">What your team did in the last day.</p>
              </header>
              <ol class="bootcn-card__content bootcn-activity__list">
                <li class="bootcn-activity__item">
                  <span class="bootcn-avatar bootcn-avatar--sm" aria-hidden="true"
                    ><span class="bootcn-avatar__fallback">MP</span></span
                  >
                  <div class="bootcn-activity__body">
                    <p class="bootcn-activity__text">
                      <strong>Maria Papadopoulou</strong> merged <a href="#">Release 2.4</a>
                    </p>
                    <time class="bootcn-activity__time" datetime="2026-11-24T09:12"
                      >12 minutes ago</time
                    >
                  </div>
                </li>
                <li class="bootcn-activity__item">
                  <span class="bootcn-avatar bootcn-avatar--sm" aria-hidden="true"
                    ><span class="bootcn-avatar__fallback">NG</span></span
                  >
                  <div class="bootcn-activity__body">
                    <p class="bootcn-activity__text">
                      <strong>Nikos Georgiou</strong> commented on <a href="#">Checkout redesign</a>
                    </p>
                    <time class="bootcn-activity__time" datetime="2026-11-24T08:40"
                      >44 minutes ago</time
                    >
                  </div>
                </li>
                <li class="bootcn-activity__item">
                  <span class="bootcn-avatar bootcn-avatar--sm" aria-hidden="true"
                    ><span class="bootcn-avatar__fallback">EK</span></span
                  >
                  <div class="bootcn-activity__body">
                    <p class="bootcn-activity__text">
                      <strong>Eleni Kosta</strong> invited <a href="#">two new members</a>
                    </p>
                    <time class="bootcn-activity__time" datetime="2026-11-24T07:05"
                      >2 hours ago</time
                    >
                  </div>
                </li>
                <li class="bootcn-activity__item">
                  <span class="bootcn-avatar bootcn-avatar--sm" aria-hidden="true"
                    ><span class="bootcn-avatar__fallback">AI</span></span
                  >
                  <div class="bootcn-activity__body">
                    <p class="bootcn-activity__text">
                      <strong>Alex Ioannou</strong> closed <a href="#">Issue #182</a>
                    </p>
                    <time class="bootcn-activity__time" datetime="2026-11-23T16:30">Yesterday</time>
                  </div>
                </li>
              </ol>
              <footer class="bootcn-card__footer bootcn-activity__footer">
                <a href="#activity">View all activity</a>
              </footer>
            </section>
          </div>
          <section
            class="card bootcn-card bootcn-transactions"
            aria-labelledby="bootcn-transactions-title"
          >
            <header class="bootcn-card__header bootcn-transactions__header">
              <div>
                <h2 class="bootcn-card__title" id="bootcn-transactions-title">
                  Recent transactions
                </h2>
                <p class="bootcn-card__description">Payments from the last 30 days.</p>
              </div>
              <form
                class="bootcn-transactions__tools"
                role="search"
                aria-label="Transactions"
                action="#"
              >
                <label class="visually-hidden" for="bootcn-transactions-search"
                  >Search transactions</label
                >
                <input
                  type="search"
                  class="form-control bootcn-input bootcn-transactions__search"
                  id="bootcn-transactions-search"
                  name="q"
                  placeholder="Search customers"
                />
                <button type="submit" class="visually-hidden">Search</button>
                <button type="button" class="btn bootcn-button bootcn-button--outline">
                  <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="M12 4v12" />
                    <path d="M7 11l5 5 5-5" />
                    <path d="M5 20h14" />
                  </svg>
                  Export
                </button>
              </form>
            </header>
            <div class="table-responsive">
              <table class="table bootcn-transactions__table mb-0">
                <caption class="visually-hidden">
                  Recent transactions, newest first
                </caption>
                <thead>
                  <tr>
                    <th scope="col">Customer</th>
                    <th scope="col">Status</th>
                    <th scope="col">Date</th>
                    <th scope="col" class="text-end">Amount</th>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>
                      <span class="bootcn-transactions__name">Maria Papadopoulou</span>
                      <span class="bootcn-transactions__email">maria@example.com</span>
                    </td>
                    <td><span class="badge bootcn-badge bootcn-badge--default">Paid</span></td>
                    <td><time datetime="2026-11-23">23 Nov 2026</time></td>
                    <td class="text-end bootcn-transactions__amount">€250.00</td>
                  </tr>
                  <tr>
                    <td>
                      <span class="bootcn-transactions__name">Nikos Georgiou</span>
                      <span class="bootcn-transactions__email">nikos@example.com</span>
                    </td>
                    <td><span class="badge bootcn-badge bootcn-badge--secondary">Pending</span></td>
                    <td><time datetime="2026-11-22">22 Nov 2026</time></td>
                    <td class="text-end bootcn-transactions__amount">€1,120.00</td>
                  </tr>
                  <tr>
                    <td>
                      <span class="bootcn-transactions__name">Eleni Kosta</span>
                      <span class="bootcn-transactions__email">eleni@example.com</span>
                    </td>
                    <td><span class="badge bootcn-badge bootcn-badge--outline">Refunded</span></td>
                    <td><time datetime="2026-11-21">21 Nov 2026</time></td>
                    <td class="text-end bootcn-transactions__amount">€89.90</td>
                  </tr>
                  <tr>
                    <td>
                      <span class="bootcn-transactions__name">Alex Ioannou</span>
                      <span class="bootcn-transactions__email">alex@example.com</span>
                    </td>
                    <td>
                      <span class="badge bootcn-badge bootcn-badge--destructive">Failed</span>
                    </td>
                    <td><time datetime="2026-11-20">20 Nov 2026</time></td>
                    <td class="text-end bootcn-transactions__amount">€430.00</td>
                  </tr>
                  <tr>
                    <td>
                      <span class="bootcn-transactions__name">Sofia Dimou</span>
                      <span class="bootcn-transactions__email">sofia@example.com</span>
                    </td>
                    <td><span class="badge bootcn-badge bootcn-badge--default">Paid</span></td>
                    <td><time datetime="2026-11-19">19 Nov 2026</time></td>
                    <td class="text-end bootcn-transactions__amount">€72.50</td>
                  </tr>
                </tbody>
              </table>
            </div>
            <footer class="bootcn-card__footer bootcn-transactions__footer">
              <p class="bootcn-transactions__summary">Showing 1–5 of 42</p>
              <nav class="bootcn-transactions__pages" aria-label="Transactions pages">
                <a
                  class="btn bootcn-button bootcn-button--outline bootcn-button--sm"
                  aria-disabled="true"
                  tabindex="-1"
                  >Previous</a
                >
                <a class="btn bootcn-button bootcn-button--outline bootcn-button--sm" href="#page-2"
                  >Next</a
                >
              </nav>
            </footer>
          </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}}/admin-dashboard.js"></script>
  </body>
</html>
css
/*
 * Admin dashboard layout: a sidebar column from 992px (an off-canvas drawer
 * below), a sticky top bar, and the page content. Blocks bring their own CSS.
 */
.bootcn-admin {
  min-height: 100vh;
  background-color: var(--bs-body-bg);
}

.bootcn-admin__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(--bs-body-bg);
  box-shadow: var(--bootcn-focus-ring);
}

.bootcn-admin__layout {
  display: flex;
  min-height: 100vh;
}

@media (min-width: 992px) {
  .bootcn-admin .bootcn-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }
}

.bootcn-admin__main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.bootcn-admin__topbar {
  position: sticky;
  z-index: 1020;
  top: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-bottom: var(--bootcn-border-width) solid var(--bootcn-border-color);
  background-color: var(--bs-body-bg);
}

.bootcn-admin__search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 24rem;
}

.bootcn-admin__topbar-end {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

/* Theme toggle: the moon offers dark mode, the sun offers light mode. */
[data-bs-theme='dark'] .bootcn-admin__when-light,
[data-bs-theme='light'] .bootcn-admin__when-dark {
  display: none;
}

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

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

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

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

/* Bar chart: decorative; the same data is in a visually hidden table. */
.bootcn-bar-chart {
  display: flex;
  align-items: stretch;
  gap: 0.375rem;
  height: 14rem;
}

.bootcn-bar-chart__col {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.375rem;
  min-width: 0;
}

.bootcn-bar-chart__bar {
  width: 100%;
  max-width: 2.5rem;
  height: calc(var(--bootcn-bar-value, 0) * (100% - 1.5rem));
  border-radius: var(--bootcn-radius-sm) var(--bootcn-radius-sm) 0 0;
  background-color: var(--bs-primary);
}

.bootcn-bar-chart__label {
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
  line-height: 1;
}

@media (max-width: 575.98px) {
  .bootcn-bar-chart__col:nth-child(even) .bootcn-bar-chart__label {
    visibility: hidden;
  }
}
js
/*
 * Admin 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.adminDashboard = { 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.