Composed Responsive Container

Preview

Loading…

Installation

CLI
npx @sonojs/ui@latest add composed-responsive-container
Also needsnpx @sonojs/ui@latest add chart chart-styles && npm i recharts

Usage

import
import ComposedResponsiveContainerDemo from "@/components/charts/composed-responsive-container"
page.tsx
export default function Page() {
  return <ComposedResponsiveContainerDemo />
}

Scrub

scrub highlights the active category and dims the rest (default true). Pass false to keep the idle last-category view.

scrub
import { ComposedResponsiveContainer } from "@/components/charts/composed-responsive-container"

export default function Page() {
  return <ComposedResponsiveContainer scrub={false} />
}

Plot direction

plotDir only flips the plot (bars / axes). Header and legend still follow page dir. Omit it to match the page (default).

plotDir
import { ComposedResponsiveContainer } from "@/components/charts/composed-responsive-container"

export default function Page() {
  return (
    <div dir="rtl">
      {/* Chrome RTL · bars still start on the left */}
      <ComposedResponsiveContainer plotDir="ltr" />
    </div>
  )
}

Props

PropTypeDefaultDescription
scrubbooleantrueHover, touch, and keyboard scrub — dim inactive categories and update the metric header.
plotDir"ltr" · "rtl"page dirPlot-only layout (bar sides / axes). Header and legend keep following page dir.