Intent UI

Bar Chart

Cards 16

About

Here is Bar Chart component

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

Code

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

Usage.tsx

"use client"

import { Card } from "@/components/ui/card"
import { Chart, type ChartConfig, ChartTooltip, ChartTooltipContent } from "@/components/ui/bar-chart"
import { Bar, BarChart, CartesianGrid, LabelList, XAxis, YAxis } from "recharts"

const projectData = [
  { team: "Engineering", completed: 42, ongoing: 15 },
  { team: "Design", completed: 30, ongoing: 5 },
  { team: "Marketing", completed: 25, ongoing: 10 },
  { team: "Sales", completed: 20, ongoing: 8 },
  { team: "Support", completed: 35, ongoing: 12 },
  { team: "Engineering", completed: 42, ongoing: 15 },
  { team: "Design", completed: 30, ongoing: 5 },
  { team: "Marketing", completed: 25, ongoing: 10 },
  { team: "Sales", completed: 20, ongoing: 8 },
  { team: "Support", completed: 35, ongoing: 12 },
  { team: "Engineering", completed: 42, ongoing: 15 },
  { team: "Design", completed: 30, ongoing: 5 },
]

const chartConfig = {
  completed: {
    label: "Completed",
    color: "var(--chart-1)",
  },
  ongoing: {
    label: "Ongoing",
    color: "var(--chart-2)",
  },
  label: {
    color: "var(--bg)",
  },
} satisfies ChartConfig

export default function Component() {
  return (
    <Card>
      <Card.Header
        title="Team Project Status"
        description="Completed vs Ongoing Projects by Team"
      />
      <Card.Content>
        <Chart config={chartConfig}>
          <BarChart
            accessibilityLayer
            data={projectData}
            layout="vertical"
            margin={{
              right: 16,
            }}
          >
            <CartesianGrid horizontal={false} />
            <YAxis
              dataKey="team"
              type="category"
              tickLine={false}
              tickMargin={10}
              axisLine={false}
            />
            <XAxis dataKey="completed" type="number" hide />
            <ChartTooltip cursor={false} content={<ChartTooltipContent indicator="line" />} />
            <Bar dataKey="completed" layout="vertical" fill="var(--color-completed)" radius={4}>
              <LabelList
                dataKey="team"
                position="insideLeft"
                offset={8}
                className="fill-(--color-label)"
                fontSize={12}
              />
              <LabelList
                dataKey="completed"
                position="right"
                offset={8}
                className="fill-fg"
                fontSize={12}
              />
            </Bar>
          </BarChart>
        </Chart>
      </Card.Content>
    </Card>
  )
}

Dependencies

More by Intent UI

View all
  • Radar Chart

    Radar Chart

    217
  • Radial Chart

    Radial Chart

    77
  • Pie Chart

    Pie Chart

    31
  • Toggle Group

    Toggle Group

    26
  • Loader

    Loader

    23
  • Progress Bar

    Progress Bar

    19
  • Color Slider

    Color Slider

    13
  • File Trigger 13

    File Trigger 13

    10

More in Cards

View all
  • Statistics Card 2

    Statistics Card 2

    264
  • Course Design Cards

    Course Design Cards

    1.1K
  • Card

    Card

    70
  • Stats cards with links

    Stats cards with links

    39
  • The Item one

    The Item one

    3
  • Card Studio

    Card Studio

    7
  • Statistics Card 7

    Statistics Card 7

    292
  • Item

    Item

    10