PromptFork

Tailwind analytics dashboard with animated stat cards, dark mode, and skeleton loading

Production-grade dashboard layout: KPI cards with counting animations and trend sparklines, a chart area, activity table — all with dark mode, skeleton loading states, and responsive breakpoints defined to the pixel.

Open in Studio
Prompt
Act as a product designer-engineer who ships polished internal tools. Build a responsive analytics dashboard using React + Tailwind CSS only (no component library, no charting library).

Layout (mobile-first):
- **Top row — 4 KPI stat cards**: label, large value, delta badge vs last period (emerald-500 + ▲ for positive, red-500 + ▼ for negative), and a tiny inline sparkline (a 7-point SVG polyline showing the last 7 days). Cards stack 1-up on mobile, 2-up at `sm`, 4-up at `lg`.
- **Middle row**: one large chart container (placeholder div with dashed border and label) spanning `lg:col-span-2`, and a compact 'Top Items' list card spanning `lg:col-span-1`. Both full-width on mobile.
- **Bottom**: a recent-activity table with sticky header, zebra rows (`even:bg-gray-50 dark:even:bg-gray-800`), and a 'Load more' button.

Micro-interactions (CSS + React only):
- Stat card values use a counting-up animation on mount: start from 0, ease-out to the real number over 600ms using `requestAnimationFrame`. Extract this into a `useCountUp(target, duration)` hook.
- Delta badges fade-and-slide in (`opacity-0 translate-y-1` → `opacity-100 translate-y-0`) with a 200ms delay after the count finishes.
- Cards have `hover:shadow-lg hover:-translate-y-0.5 transition-all duration-200`.

Dark mode:
- Support `class` strategy (`dark:` variants). Provide a toggle button in the top-right that adds/removes `dark` on `<html>`.
- Define all custom colors via CSS variables so theming is one-place: `--color-surface`, `--color-surface-alt`, `--color-text-primary`, `--color-text-muted`.

Skeleton loading:
- Export a `<DashboardSkeleton />` component that mirrors the exact layout with `animate-pulse` placeholder blocks (rounded rectangles matching each element's dimensions). Use this as the loading state.

Accessibility: real `<table>` with `<thead>`/`<tbody>`, `aria-label` on icon-only buttons, visible `focus-visible:ring-2` rings, `prefers-reduced-motion:` disables all animations.

Keep it one file. Use placeholder data arrays at the top (4 KPI objects, 5 list items, 8 table rows). Return the complete component.
Source
promptfork seed
License
CC-BY-4.0
Published
6/23/2026

More prompts you might like

Next.js 15 App Router page with streaming, caching, and server data

Scaffold a production App Router page: Server Component data fetching, Suspense streaming for instant TTFB, correct cache strategy (fetch cache vs unstable_cache vs revalidatePath), loading/error boundaries, and generateMetadata — with the non-obvious patterns most tutorials skip.

New

Supabase RLS: owner-write, public-read policies for a table

Generate correct, non-recursive RLS policies so anyone reads published rows and only owners edit their own.

New

Stripe webhook handler with signature verify + idempotency

Production-ready Stripe webhook route that verifies the signature and processes events exactly once.

New

.cursorrules for a strict TypeScript + React codebase

A tuned .cursorrules file that keeps Cursor's agent on-convention: strict types, no dead code, match existing patterns.

New

Refactor a React component into clean custom hooks

Extract stateful logic from a bloated component into typed, testable custom hooks.

New

Diagnose and fix a slow SQL query using EXPLAIN ANALYZE like a DBA

Paste a slow query and get a root-cause diagnosis, targeted index/rewrite fixes, and a before/after query plan — with specific pattern detection for N+1s, implicit casts, and composite index gaps.

New