feega

free UI sections and components / app UI

dashboard stats cards

By Andrea Buttarelli, founder of Feega · Free · Svelte, React, Vue, Astro, HTML

Four metric cards with change badge and a tiny bar sparkline.

dashboardstatscards

code

StatsCards.svelte
<section class="fl-stats-cards" aria-label="Key metrics">
  <article class="card"><header><span>Revenue</span><em class="fl-badge fl-badge--success">+8.2%</em></header><p class="v">$48,210</p><div class="spark" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div></article>
  <article class="card"><header><span>Active users</span><em class="fl-badge fl-badge--success">+3.1%</em></header><p class="v">3,904</p><div class="spark" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div></article>
  <article class="card"><header><span>Conversion</span><em class="fl-badge fl-badge--danger">−0.4%</em></header><p class="v">4.6%</p><div class="spark" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div></article>
  <article class="card"><header><span>Open tickets</span><em class="fl-badge fl-badge--accent">5 new</em></header><p class="v">27</p><div class="spark" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div></article>
</section>

<style>
.fl-stats-cards{font-family:var(--feega-font);font-size:var(--feega-text-body);line-height:1.5;letter-spacing:var(--feega-tracking);color:var(--feega-fg);background:var(--feega-bg);-webkit-font-smoothing:antialiased}
:where(.fl-stats-cards) *,:where(.fl-stats-cards) *::before,:where(.fl-stats-cards) *::after{box-sizing:border-box}
:where(.fl-stats-cards) :is(h1,h2,h3,h4,p,ul,ol,figure,blockquote,dl,dd){margin:0}
:where(.fl-stats-cards) a{color:inherit;text-decoration:none}
:where(.fl-stats-cards) :focus-visible{outline:2px solid var(--feega-focus);outline-offset:3px}
.fl-px{display:block;flex:none;width:1em;height:auto;fill:currentColor;shape-rendering:crispEdges}
.fl-badge{display:inline-flex;align-items:center;gap:6px;min-height:24px;padding:0 10px;border-radius:var(--feega-radius-full);background:var(--feega-surface);color:var(--feega-fg-muted);font-size:var(--feega-text-xs);font-weight:500;letter-spacing:0;white-space:nowrap}
.fl-badge::before{content:"";width:6px;height:6px;border-radius:var(--feega-radius-full);background:currentColor}
.fl-badge--accent{background:var(--feega-accent-soft);color:var(--feega-accent-text)}
.fl-badge--success{background:var(--feega-success-soft);color:var(--feega-success)}
.fl-badge--danger{background:var(--feega-danger-soft);color:var(--feega-danger)}
.fl-stats-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(14rem,100%),1fr));gap:var(--feega-space-3);padding:var(--feega-space-6) var(--feega-gutter)}
.fl-stats-cards .card{display:grid;gap:var(--feega-space-3);padding:var(--feega-space-6);border-radius:var(--feega-radius-lg);background:var(--feega-raised);box-shadow:inset 0 0 0 1px var(--feega-line)}
.fl-stats-cards header{display:flex;justify-content:space-between;align-items:center;gap:var(--feega-space-2);color:var(--feega-fg-muted);font-size:var(--feega-text-sm);font-weight:500}
.fl-stats-cards em{font-style:normal}
.fl-stats-cards .v{font-size:clamp(2rem,3.4vw,2.5rem);font-weight:500;line-height:1;letter-spacing:var(--feega-tracking-tight);font-variant-numeric:tabular-nums}
.fl-stats-cards .spark{display:flex;align-items:flex-end;gap:3px;height:32px}
.fl-stats-cards .spark i{flex:1;height:var(--h);border-radius:1px;background:var(--feega-line-strong)}
.fl-stats-cards .spark i:nth-child(1){--h:30%}
.fl-stats-cards .spark i:nth-child(2){--h:45%}
.fl-stats-cards .spark i:nth-child(3){--h:38%}
.fl-stats-cards .spark i:nth-child(4){--h:52%}
.fl-stats-cards .spark i:nth-child(5){--h:48%}
.fl-stats-cards .spark i:nth-child(6){--h:60%}
.fl-stats-cards .spark i:nth-child(7){--h:55%}
.fl-stats-cards .spark i:nth-child(8){--h:68%}
.fl-stats-cards .spark i:nth-child(9){--h:74%}
.fl-stats-cards .spark i:nth-child(10){--h:90%}
.fl-stats-cards .spark i:last-child{background:var(--feega-accent)}
@media (prefers-reduced-motion:reduce){:where([class^="fl-"]) *,:where([class^="fl-"]) *::before,:where([class^="fl-"]) *::after{animation:none!important;transition:none!important}}
</style>
tokens.css, the shared file every template reads
tokens.cssopen file
:root,
[data-theme="light"] {
  color-scheme: light;
  --feega-bg: #f7f6f2;
  --feega-surface: #efede7;
  --feega-raised: #ffffff;
  --feega-input: #ffffff;
  --feega-fg: #121212;
  --feega-fg-muted: #5c5a55;
  --feega-fg-subtle: #6d6a63;
  --feega-line: #e2dfd7;
  --feega-line-strong: #cdc9bf;
  --feega-dot: #d3cfc5;
  --feega-accent: #ff4f00;
  --feega-accent-hover: #ff6a26;
  --feega-accent-fg: #121212;
  --feega-accent-soft: #ffe8dc;
  --feega-accent-text: #b83800;
  --feega-danger: #c0231a;
  --feega-danger-fg: #ffffff;
  --feega-danger-soft: #fde6e3;
  --feega-success: #12703a;
  --feega-success-soft: #e0f3e6;
  --feega-focus: #ff4f00;
  --feega-overlay: rgb(18 18 18 / 0.4);
  --feega-shadow: 0 1px 2px rgb(18 18 18 / 0.05), 0 8px 24px -8px rgb(18 18 18 / 0.12);
  --feega-shadow-float: 0 2px 4px rgb(18 18 18 / 0.06), 0 24px 48px -12px rgb(18 18 18 / 0.22);
  --feega-radius-xs: 2px;
  --feega-radius-sm: 6px;
  --feega-radius-md: 10px;
  --feega-radius-lg: 16px;
  --feega-radius-full: 999px;
  --feega-font: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --feega-font-display: var(--feega-font);
  --feega-font-mono: "Fragment Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --feega-tracking: -0.02em;
  --feega-tracking-tight: -0.05em;
  --feega-text-xs: 0.75rem;
  --feega-text-sm: 0.875rem;
  --feega-text-body: 1rem;
  --feega-text-lg: clamp(1.0625rem, 1.6vw, 1.25rem);
  --feega-text-xl: 1.5rem;
  --feega-text-title: clamp(2.5rem, 6vw, 4.5rem);
  --feega-text-display: clamp(3rem, 9.5vw, 7rem);
  --feega-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --feega-dur-fast: 160ms;
  --feega-dur: 420ms;
  --feega-space-1: 0.25rem;
  --feega-space-2: 0.5rem;
  --feega-space-3: 0.75rem;
  --feega-space-4: 1rem;
  --feega-space-6: 1.5rem;
  --feega-space-8: 2rem;
  --feega-space-12: 3rem;
  --feega-space-16: 4rem;
  --feega-space-section: clamp(4.5rem, 11vw, 9rem);
  --feega-gutter: clamp(1rem, 4vw, 2rem);
  --feega-max-width: 76rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --feega-bg: #050505;
    --feega-surface: #121212;
    --feega-raised: #1a1a1a;
    --feega-input: #0d0d0d;
    --feega-fg: #f0eee9;
    --feega-fg-muted: #a3a09a;
    --feega-fg-subtle: #8a877f;
    --feega-line: #232323;
    --feega-line-strong: #363636;
    --feega-dot: #2c2c2c;
    --feega-accent: #ff5a14;
    --feega-accent-hover: #ff7333;
    --feega-accent-fg: #121212;
    --feega-accent-soft: #2b1206;
    --feega-accent-text: #ff7a3d;
    --feega-danger: #ff6b5e;
    --feega-danger-fg: #121212;
    --feega-danger-soft: #2e0f0c;
    --feega-success: #4cc47a;
    --feega-success-soft: #0d2617;
    --feega-focus: #ff5a14;
    --feega-overlay: rgb(0 0 0 / 0.7);
    --feega-shadow: 0 1px 2px rgb(0 0 0 / 0.5), 0 8px 24px -8px rgb(0 0 0 / 0.6);
    --feega-shadow-float: 0 2px 4px rgb(0 0 0 / 0.5), 0 24px 48px -12px rgb(0 0 0 / 0.8);
  }
}

[data-theme="dark"] {
  color-scheme: dark;
  --feega-bg: #050505;
  --feega-surface: #121212;
  --feega-raised: #1a1a1a;
  --feega-input: #0d0d0d;
  --feega-fg: #f0eee9;
  --feega-fg-muted: #a3a09a;
  --feega-fg-subtle: #8a877f;
  --feega-line: #232323;
  --feega-line-strong: #363636;
  --feega-dot: #2c2c2c;
  --feega-accent: #ff5a14;
  --feega-accent-hover: #ff7333;
  --feega-accent-fg: #121212;
  --feega-accent-soft: #2b1206;
  --feega-accent-text: #ff7a3d;
  --feega-danger: #ff6b5e;
  --feega-danger-fg: #121212;
  --feega-danger-soft: #2e0f0c;
  --feega-success: #4cc47a;
  --feega-success-soft: #0d2617;
  --feega-focus: #ff5a14;
  --feega-overlay: rgb(0 0 0 / 0.7);
  --feega-shadow: 0 1px 2px rgb(0 0 0 / 0.5), 0 8px 24px -8px rgb(0 0 0 / 0.6);
  --feega-shadow-float: 0 2px 4px rgb(0 0 0 / 0.5), 0 24px 48px -12px rgb(0 0 0 / 0.8);
}

what it is

Dashboard stats cards is a free app UI piece. Four metric cards with change badge and a tiny bar sparkline. It is tagged dashboard, stats and cards.

It is markup and CSS only, with no script in any version.

Size per version: Svelte 1 file, 40 lines; React 2 files, 44 lines; Vue 1 file, 42 lines; Astro 1 file, 43 lines; HTML 2 files, 38 lines.

tokens this template reads

TokenControlsUses
--feega-fg-mutedsecondary text2
--feega-radius-fullfully round pills and buttons2
--feega-space-3spacing step 32
--feega-space-6spacing step 62
--feega-accentthe brand colour on primary actions1
--feega-accent-softtinted accent backgrounds1
--feega-accent-textaccent used as text1
--feega-bgthe page background1
--feega-dangerdestructive actions and errors1
--feega-danger-softtinted error backgrounds1
--feega-fgmain text1
--feega-focusthe keyboard focus ring1

To restyle it, set any of these custom properties on :root, or on an ancestor of the template to change it in one place only. For example, --feega-accent changes the brand colour in light and dark alike. Add the shared tokens.css once per project.

fonts

It uses Inter Tight (400, 500, 600) from Google Fonts. Without them the font tokens fall back to a system stack.

head
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600&display=swap" />

insert with Feega

Open Add, then Library, and click Insert or drag it into your running app. Feega writes the component, tokens and fonts for your framework. One undo. how it works

Free VS Code extension. No account, no AI.

get feega →

related templates