Search documentation

Search for a page or component.

Distribution Bar

A single stacked bar showing how a total splits across categories.

  • Desktop61.2%(61.4K)
  • Mobile34.1%(34.2K)
  • Tablet4.1%(4.1K)
  • Other0.6%(640)
import { DistributionBar } from "@/components/ui/distribution-bar"

const devices = [

A single stacked bar that shows how a total splits across categories, with a legend. Use it for storage by type, revenue by plan, or traffic by source when a pie chart would take too much room.

Installation

pnpm dlx shadcn@latest add @dashboardcn/distribution-bar

Usage

import { DistributionBar } from "@/components/ui/distribution-bar"

<DistributionBar
  segments={[
    { name: "Desktop", value: 61400 },
    { name: "Mobile", value: 34200 },
    { name: "Tablet", value: 4100 },
  ]}
/>