Chart Container

PreviousNext

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.

PropTypeDescription
titlestringThe title displayed above the chart.
descriptionstringThe description text displayed below the title.
childrenReactNodeThe chart component to be wrapped.
styleViewStyleAdditional 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