Skip to Content

Demographics Card

Audience demographics report card listing age groups as labelled progress bars, with a link button that opens a dialog table of readers and share per band, computed from a total.

Installation

pnpm dlx shadcn@latest add @01orbital/demographics-card

Usage

import { DemographicsCard } from "@/components/card/demographics-card"

Needs props to render

Pass title, bands, total, labels; see the API reference below.

API reference

A card of percentage bars, one per band, with a link that opens the same bands as a table of counts and shares. Other props go to the Card.

Prop

Type

It also accepts the HTML attributes of the element it renders, and the props of the stock Card it builds on.

Dependencies

npm: @phosphor-icons/react. The CLI installs it for you.

Requires these pieces. The CLI adds each one that is missing and won't replace a file you already have unless you choose to:

The shadcn parts here are their Base UI versions, and this piece uses Base UI's API. A Radix version you already have won't work with it.

Used in blocks

One block is built with Demographics Card.

Last updated on