Skip to content

KPI Cards with Progress

Dark Bootstrap 5 KPI cards with trend badges, goal progress bars and a Month, Quarter and Year switch for admin and sales dashboards.

Also known as: kpi dashboard cards, metric cards with goal progress, sales stats cards, dashboard stat widgets

Bootstrap 5 Stat Cards Responsive Dark #card #dashboard #progress #responsive #stats

KPI Cards with Progress live demo

Open in new tab

Bootstrap 5 code (HTML, CSS, JS)

A dark Bootstrap 5 KPI card grid that shows four business metrics with a trend badge, a goal progress bar and a Month / Quarter / Year switch. Use it at the top of admin dashboards, sales reports and analytics pages.

How it works

The root is section.kp-kpis. The header holds the title, the .kp-summary line and the .kp-period button group, built from Bootstrap btn-check radio inputs. The cards sit in a row row-cols-1 row-cols-sm-2 row-cols-xl-4, so they stack on phones, form a 2×2 grid on tablets and a single row on wide screens.

Each article.kp-card stores its numbers as JSON in data-kp-month, data-kp-quarter and data-kp-year, for example {"value":48250,"goal":60000,"trend":12.4}, and data-kp-format (currency, number or percent) decides how they are printed with Intl.NumberFormat. On DOMContentLoaded the script renders the checked period: it fills .kp-value and .kp-goal__target, computes the goal percentage, sets the .progress-bar width (capped at 100%) and swaps .kp-trend--up / .kp-trend--down with the matching arrow icon. Cards at or above their goal get .kp-card--met, which colors the percentage and adds a check icon. Listening for change on the radios re-renders every card and updates .kp-summary ("3 of 4 goals on track this year"). The bars grow with a CSS width transition.

Customization

  • --kp-bg, --kp-surface, --kp-border, --kp-text and --kp-muted in .kp-kpis: retheme the section, for example with light colors for a light dashboard.
  • .kp-card--lime, .kp-card--cyan, .kp-card--amber and .kp-card--pink: each sets --kp-tone and --kp-tone-rgb, which color the icon, the glow and the progress bar. Add your own modifier with two variables.
  • data-kp-month, data-kp-quarter and data-kp-year on .kp-card: replace the sample JSON with real values from your API.
  • data-kp-format on .kp-card: switch between currency, number and percent; edit the currency formatter in script.js to show EUR or GBP.
  • --kp-up and --kp-down in .kp-kpis: change the colors of positive and negative trend badges.
  • --kp-bar-height in .kp-kpis: make the progress bars thicker or thinner.
  • row-cols-xl-4 on the card row: use row-cols-xl-3 for three metrics per row.

Use cases

  • Admin dashboards: four key metrics sit at the top with trend badges showing change since the last period
  • Sales reports: each card shows progress toward a revenue goal with a bar and percentage
  • Analytics pages: a Month, Quarter and Year switch re-renders every metric without reloading
  • Team performance boards: cards that reach their goal get a check icon and highlighted percentage

Accessibility

The section is labelled by #kp-title, and the period switch is a role="group" with a label, so it works with Tab and arrow keys like any radio group and shows a visible outline on focus. Each .progress element has role="progressbar", an aria-label, aria-valuenow and an aria-valuetext such as "118% of goal", so overachieved goals are read correctly. Trend badges include visually hidden text, and .kp-summary is a polite live region that announces the new totals after a period change. Icons are aria-hidden. The bar transition and card hover lift are disabled with prefers-reduced-motion: reduce.

Usage notes

Requires Bootstrap 5 and Bootstrap Icons. The bar widths are set by script.js, so without JavaScript the numbers and percentages are still shown but the bars stay empty. Several .kp-kpis sections can live on one page; give each a different radio name and unique id/for pairs.

KPI Cards with Progress at a glance

Framework
Bootstrap 5
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 5, Bootstrap Icons
Layout
Responsive, works on mobile, dark design
Category
Stat Cards
License
Free for personal and commercial use

Questions about this template

Can I use the KPI Cards with Progress code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 5 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
  • <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
KPI Cards with Progress – free Bootstrap 5 stat card template
KPI Cards with Progress · free Bootstrap 5 stat card template

More Stat Cards

Stat Card with Sparkline – free Pure CSS stat card template

Stat Card with Sparkline

Pure CSS KPI cards with a big value, colored trend badge, low/high range and an inline SVG sparkline that redraws itself on hover.

Stat Cards with Trend – free Tailwind CSS stat card template

Stat Cards with Trend

Tailwind CSS KPI stat cards with change percentage pills and animated SVG sparklines generated from a data attribute.