DocsComponentsTemplatesThemesGitHub

StatTile

KPI tile: label, big tabular value, delta badge with arrow, footnote.

Code

import * as React from 'react';
import { StatTile } from '@fruit-labs/design';

export default function Demo() {
  return (
    <div
      style={{
        display: 'grid',
        gridTemplateColumns: 'repeat(2,minmax(0,1fr))',
        gap: 12,
        maxWidth: 460,
      }}
    >
      <StatTile label="Revenue" value="₹4.2L" delta="12%" footnote="vs. last 30 days" />
      <StatTile
        label="Churn"
        value="2.1%"
        delta="0.4%"
        trend="up"
        good={false}
        footnote="vs. last 30 days"
      />
    </div>
  );
}

Install

From npm:

npm install @fruit-labs/design

import { StatTile } from '@fruit-labs/design';

Or copy the TypeScript source into your project:

npx shadcn@latest add https://design.fruitlabs.online/r/stat-tile.json

Guidelines

  • One metric per tile. Delta pairs an arrow with color. Set good={false} when up is bad (churn).

Props

PropTypeRequired
labelReact.ReactNodeYes
valueReact.ReactNodeYes
deltastringNo
trend'up' | 'down'No
goodbooleanNo
footnoteReact.ReactNodeNo
classNamestringNo

Edit this example on GitHub