Kinetik UI

Rain Bars

.md

A short rain forecast: bars hang from a band and reach down in turn while a few drops keep falling.

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

Installation

Kinetik CLI
npx kinetik-ui add rain-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/rain-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/rain-bars.tsx
    View source files

Usage

import { RainBars } from '@/components/kinetik/rain-bars';

<RainBars
  title="Steady Rain"
  total={19}
  amounts={[3, 5, 8, 6, 9, 12, 16, 11, 7, 10, 14, 18, 15, 9, 6, 8, 12, 17, 13, 8, 5, 7, 4, 3]}
  times={['NOW', '12:30', '13:00', '13:30']}
/>;

When to use

  • The next hour or two of rain in a weather app.
  • Any short forecast where the shape over time matters.

When not to use

  • Long forecasts: the bars get too thin past about 40.
  • Exact amounts per period. There is no scale.

Notes

  • The first bar is now and is drawn in white.
  • Times are spread evenly under the bars.

Props

RainBarsProps

PropTypeDefaultDescription
titlerequiredstring—Heading, e.g. "Steady Rain".
totalrequirednumber—Total in the corner, e.g. 19.
amountsrequirednumber[]—Rain in each period, oldest first. The first bar is now.
timesrequiredstring[]—Time labels spread under the bars, e.g. ["NOW", "12:30", "13:00"].
unitstring'MM'Unit after the total. Defaults to "MM".
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
Bars use short UI-thread springs on arrival. Five small drop views loop on the UI thread, so it animates at rest.
Measured

Huawei P20 Lite (ANE-LX1), Android 9, release build · 17 ms median frame, 18 ms p90 · keeps drawing at rest · 119 MB app memory

Accessibility

Reduced motion
Bars appear in place and no drops fall.
Screen readers
One label ("Steady Rain, 19 MM expected").
Touch target
Not interactive.

Source files

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