Chart Container

A container component for wrapping charts with title, description, and consistent styling.

Installation

pnpm dlx bna-ui add chart-container

Usage

import { ChartContainer } from '@/components/charts/chart-container';
<ChartContainer
  title='Monthly Revenue'
  description='Revenue data for the last 6 months'
>
  {/* Your chart component goes here */}
</ChartContainer>

Examples

Default

Custom Styling

API Reference

ChartContainer

A container component that provides consistent styling and layout for charts.

PropTypeDefaultDescription
titlestring-The title displayed above the chart.
descriptionstring-The description text displayed below the title.
childrenReactNode-The chart component to be wrapped.
styleViewStyle-Additional styles to apply to the container.

Accessibility

The ChartContainer component is built with accessibility in mind:

  • Uses semantic structure for screen readers
  • Proper heading hierarchy with title and description
  • Consistent spacing and layout
  • Supports dynamic text sizing