noahgdev

Segmented Meter

Dashboards

About

A bar meter split into zones with a marker at the current value, for heart-rate zones, portfolio allocations, or thresholds where the zone a value falls in matters more than the number.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Segmented Meter to your project and fits it to your theme.

Code

How Segmented Meter is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client"

import { SegmentedMeter } from "@/components/ui/dashboardcn-segmented-meter"

const zones = [
  { label: "Rest", from: 60, to: 110, color: "var(--color-sky-500)" },
  { label: "Fat burn", from: 110, to: 140, color: "var(--color-emerald-500)" },
  { label: "Cardio", from: 140, to: 170, color: "var(--color-amber-500)" },
  { label: "Peak", from: 170, to: 190, color: "var(--color-red-500)" },
]

export default function SegmentedMeterDemo() {
  return (
    <div className="flex w-full max-w-sm flex-col gap-8">
      <div className="flex flex-col gap-3">
        <div className="flex items-baseline gap-1.5">
          <span className="text-3xl font-semibold tabular-nums">142</span>
          <span className="text-muted-foreground">bpm</span>
        </div>
        <span className="text-sm font-medium">Heart rate zone</span>
        <SegmentedMeter value={142} zones={zones} tickFormatter={(v) => `${v}bpm`} />
      </div>
      <div className="flex flex-col gap-3">
        <span className="text-sm font-medium">All zones, with labels</span>
        <SegmentedMeter
          value={142}
          zones={zones}
          highlightActive={false}
          showTicks={false}
          showLabels
        />
      </div>
    </div>
  )
}

More by noahgdev

View all
  • Metric List

    Metric List

  • Sankey Chart

    Sankey Chart

  • Scatter Chart

    Scatter Chart

  • Radar Chart

    Radar Chart

  • Donut Chart

    Donut Chart

  • Composed Chart

    Composed Chart

  • Bar Chart

    Bar Chart

  • Funnel Chart

    Funnel Chart

More in Dashboards

View all
  • Fernly — Project Management Dashboard with Kanban

    Fernly — Project Management Dashboard with Kanban

    659
  • Analytics Dashboard

    Analytics Dashboard

    59
  • Creator Dashboard

    Creator Dashboard

    208
  • Insights Dashboard

    Insights Dashboard

    35
  • serf dashboard

    serf dashboard

    137
  • Corbel — Sales Analytics Dashboard

    Corbel — Sales Analytics Dashboard

    293
  • Dashboard with Collapsible Sidebar

    Dashboard with Collapsible Sidebar

    2.7K
  • Business/Sales Dashboard

    Business/Sales Dashboard

    1.5K