Skip to content
synccn

Bar List

New

Ranked horizontal bars for top pages, sources and more.

Top pagesVisitors
  • /components
    18,420
  • /
    12,650
  • /docs/installation
    7,340
  • /themes
    4,120
  • /blocks
    3,980
  • /components/data-table
    2,210

Installation

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

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

Usage

import { BarList } from "@/components/ui/data-viz";<BarList data={[{ name: "/", value: 1200 }]} />

API reference

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

BarList

Ranked horizontal bars with labels and values (top pages, referrers…). data: [{ name, value, href? }]

  • datarequired
    { name: string; value: number }[]

    Rows.

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

    Default (v) => v.toLocaleString()

    Formats each value.

  • sort
    boolean

    Default true

    Sort rows by value, largest first.

  • 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