Skip to content
Back to Components

bash
npm install @hua-labs/hua
tsx
import { MetricCard } from "@hua-labs/ui/advanced/dashboard";

10,234

5,678

1,234

4.5%

12.5%

32.1%

5.2%

default

1,234

elevated

1,234

gradient

1,234

outline

1,234

blue

1,234

purple

1,234

green

1,234

orange

1,234

red

1,234

indigo

1,234

pink

1,234

gray

1,234

Props

title*string-Card title displayed as a badge
value*string | number-Main metric value
descriptionstring-Additional description text
iconIconName | React.ReactNode-Icon to display
trend{ value: number; label: string; positive?: boolean }-Trend indicator with percentage
chartDatanumber[]-Array of numbers for the mini bar chart
chartLabelsstring[]-Labels for each bar in the chart
showChartbooleanfalseWhether to show the mini bar chart
variant"default" | "gradient" | "outline" | "elevated""elevated"Visual style variant
color"blue" | "purple" | "green" | "orange" | "red" | "indigo" | "pink" | "gray""blue"Color theme
loadingbooleanfalseShow loading skeleton

BasicMetricCard.tsxtsx
import { MetricCard } from "@hua-labs/ui/advanced/dashboard";

export function BasicMetricCard() {
  return (
    <MetricCard
      title="Page Views"
      value="10,234"
      description="Today"
      icon="eye"
    />
  );
}

MetricCardWithChart.tsxtsx
import { MetricCard } from "@hua-labs/ui/advanced/dashboard";

export function MetricCardWithChart() {
  return (
    <MetricCard
      title="Visitors"
      value="5,678"
      chartData={[100, 200, 150, 300, 250, 180, 220]}
      chartLabels={["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]}
      showChart
      color="blue"
      variant="elevated"
    />
  );
}

MetricCardWithTrend.tsxtsx
import { MetricCard } from "@hua-labs/ui/advanced/dashboard";

export function MetricCardWithTrend() {
  return (
    <MetricCard
      title="Conversion Rate"
      value="4.5%"
      icon="chartLine"
      trend={{
        value: 12.5,
        label: "vs last week",
        positive: true
      }}
      color="green"
      variant="gradient"
    />
  );
}