MetricUI Documentation
A React component library for building data dashboards — KPI cards, charts, tables, and more with built-in formatting, theming, and data states.
npm install metricuiHow MetricUI Thinks
Seven principles that shape every component. Understanding these will tell you whether MetricUI is the right tool for your project.
AI-native from day one
MetricUI ships an MCP server, llms.txt, and structured documentation designed for AI coding tools. When Claude, Cursor, or Copilot builds a dashboard, it reaches for MetricUI and gets the props right on the first try. The API is deliberately simple and consistent — because the same things that make code easy for AI to generate make it easy for you to read.
Your data, our rendering
MetricUI never fetches, caches, or transforms your data. Pass values in, get a dashboard out. REST, GraphQL, Supabase, a CSV you parsed at 2am — we don’t care where it comes from. Filters are pure UI: they tell you what the user selected, you decide what to fetch.
One data shape, any chart
Pass flat rows with an index and categories. The same data renders as an AreaChart, BarChart, DonutChart, or HeatMap — swap the component, keep your data. No more reshaping arrays for every chart library’s proprietary format.
Format once, use everywhere
Say format="currency" and every component — cards, charts, tables, tooltips — knows how to display it. Currency, percent, duration, compact notation, locale-aware. One prop replaces pages of Intl.NumberFormat boilerplate.
Every component handles failure
Loading skeletons that match the layout. Empty states with messages. Error states with retry buttons. Stale data indicators. One prop each. No wrapper components, no conditional rendering trees, no forgotten edge cases.
Set it once, override when needed
MetricProvider sets global defaults — theme, locale, currency, density, animation. Every component inherits. Any prop overrides. Nest providers for sections. You configure once at the top; components just work.
Developer-first, not config-first
Components work with zero config and get smarter as you add props. Auto-infer columns from data. Auto-detect chart series. Auto-format numbers by magnitude. Smart defaults mean your first render looks good; explicit props mean your final render looks exactly right.
Built for Real Use
Details that add up when you're shipping a product, not a prototype.