Skip to content
synccn

Category Bar

New

One bar split into proportional, labelled segments.

Storage68.4 GB of 100 GB
  • Video31.2 GB · 46%
  • Photos18.5 GB · 27%
  • Documents9.7 GB · 14%
  • Apps9 GB · 13%

Installation

$ pnpm dlx shadcn@latest add @synccn/category-bar

First time in this project? Connect synccn with one command.

Usage

import { CategoryBar } from "@/components/ui/data-viz";<CategoryBar data={usage} />

API reference

Generated from the component's TypeScript types, so it always matches the code.

CategoryBar

One bar split into proportional segments with a legend. data: [{ label, value, color? }]

  • datarequired
    { label: string; value: number; color?: string }[]

    Segments.

  • format
    (value: number) => React.ReactNode

    Default (v) => v

    Formats legend values.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

npm packages

Accessibility

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA attributes: aria-label