Skip to content

    Browse components

    Stats Carousel

    A carousel of KPI cards whose numbers count up and sparklines draw in as each one slides to center.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/stats-carousel

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/stats-carousel.json

    Usage

    import { StatsCarousel } from "@/components/ui/stats-carousel";
    
    <StatsCarousel
      stats={[
        { label: "Revenue", value: 48290, prefix: "$", delta: 12.4, data: [22, 27, 26, 34, 41, 44] },
        { label: "Churn", value: 1.9, decimals: 1, suffix: "%", delta: -0.6, invert: true, data: [2.8, 2.4, 2.2, 1.9] },
      ]}
    />

    Props

    PropTypeDefaultDescription
    statsReactNode—Array of { label, value, prefix?, suffix?, decimals?, delta?, invert?, data, caption? }.
    autoPlaybooleantrueAdvance automatically; pauses on hover and focus.
    intervalnumber3200Ms between slides.
    durationnumber1400Ms for the count-up and sparkline draw.
    cardWidthnumber280Card width in px.
    gapnumber20Px between cards.
    positiveColorstring"#a3e635"Accent for metrics moving the right way.
    negativeColorstring"#fb7185"Accent for metrics moving the wrong way.
    classNamestring—Extra classes for the root element.