Kinetik UI

Usage Meter

.md

What fills an allowance: segments grow into the bar in turn as the figure counts up, and the rest warns near the limit.

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

Installation

Kinetik CLI
npx kinetik-ui add usage-meter

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/usage-meter.json

Install manually

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

Usage

import { UsageMeter } from '@/components/kinetik/usage-meter';

<UsageMeter
  title="Storage"
  unit="GB"
  total={256}
  segments={[
    { label: 'Photos', value: 92 },
    { label: 'Video', value: 48 },
    { label: 'Apps', value: 21 },
  ]}
/>;

When to use

  • Allowances made of parts: storage, data plans, seats, a monthly budget.
  • Anywhere people need to see what is taking up the space before they free some.

When not to use

  • A single value against a limit. Use Gauge Meter or a plain progress bar.
  • Shares of a whole that has no limit. Use Waffle Chart or Donut Chart.

Notes

  • The remainder turns amber at warnAt (85% by default) and red, reading "over", past the allowance. The bar stops at its end.
  • Segments grow in one after another from the left; change a value and its segment, and every one after it, springs to the new place.
  • The figure counts up with useCountUp from Kinetik Count.
  • With reduced motion the bar and figure show their values at once.

Props

UsageMeterProps

PropTypeDefaultDescription
segmentsrequiredreadonly UsageSegment[]—What fills the allowance, in the same unit as `total`.
totalrequirednumber—The allowance, e.g. 200 for 200 GB.
titlerequiredstring—What is measured, e.g. "Storage". Shown as the heading and read first.
unitstring—Unit after figures, e.g. "GB".
formatValue(value: number) => stringdefaultFormatFormats figures. Defaults to one decimal place below 10, whole numbers above.
warnAtnumber0.85Share of the allowance at which the remainder turns amber. Defaults to 0.85.
colorsreadonly string[]—One colour per segment. Defaults to azure, sky, the theme ink and grey.
legendbooleantrueShow the legend. Defaults to true.
testIDstring—
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
Plain views: two shared values per segment, and a figure that re-renders on frames only while it counts. Nothing runs at rest.
Measured

Pixel 9 emulator, API 35, release build · interaction median 0.85× the system Settings app on the same emulator (indicative only) · no frames drawn at rest · 151 MB app memory

Real-device measurement pending.

Accessibility

Reduced motion
The bar and the figure show their values at once.
Screen readers
One progress indicator named by the title, whose value reads the total, what is left and every segment.
Touch target
Not interactive.

Source files

components/kinetik/usage-meter.tsx is in the Code tab of the preview above.