Kinetik UI

Month Bars

.md

Spending by month: bars rise in turn, the picked month lights teal and the figure counts to it.

v1.0.0Live on webreact-native-reanimatedreact-native-svgreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add month-bars

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/month-bars.json

Install manually

  1. Install dependencies
    npx expo install react-native-reanimated react-native-svg react-native-worklets
  2. Copy the source files
    • components/kinetik/month-bars.tsx
    View source files

Usage

import { MonthBars } from '@/components/kinetik/month-bars';

<MonthBars
  months={[
    { label: 'MAY', value: 1840.5 },
    { label: 'JUN', value: 2410.2 },
    { label: 'JUL', value: 1975.75 },
    { label: 'AUG', value: 2120 },
    { label: 'SEP', value: 2187.19 },
    { label: 'OCT', value: 2316.3 },
  ]}
/>;

When to use

  • Monthly totals in a banking or budgeting app.
  • Six or so periods where each one can be tapped.

When not to use

  • More than about eight months: targets get too narrow.
  • Precise comparisons, as bars start from a raised floor. Use Bar Chart.

Notes

  • Bars are scaled from a raised floor, so small changes are easy to see.
  • The last month starts selected.

Props

MonthBarsProps

PropTypeDefaultDescription
monthsrequiredMonthBar[]—Months, oldest first. The last one starts selected.
currencystring'$'Symbol before the figure. Defaults to "$".
hapticsbooleantrueVibrate on tap. Defaults to true.
onSelect(index: number) => void—Called with the index of a tapped month.
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
Bars use short UI-thread springs on arrival; the figure re-renders only while it counts. Nothing animates at rest.
Measured

Huawei P20 Lite (ANE-LX1), Android 9, release build · 11 ms median frame, 13 ms p90 · no frames drawn at rest · 117 MB app memory

Accessibility

Reduced motion
Bars appear in place and the figure changes without counting.
Screen readers
The figure reads as one line ("OCT: $2,316.30, +129.11") and each month as a button with its selected state.
Touch target
Each month is the full column, at least 44 pt tall.

Source files

components/kinetik/month-bars.tsx is in the Code tab of the preview above.