Kinetik UI

Money Field

.md

A currency field typed like a till: every place rolls to its new digit and separators slide in as it grows.

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

Installation

Kinetik CLI
npx kinetik-ui add money-field

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/money-field.json

Install manually

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

Usage

import { MoneyField } from '@/components/kinetik/money-field';

// `cents` is an integer: 4250 is $42.50.
<MoneyField label="Amount to send" value={cents} onChangeValue={setCents} />;

When to use

  • Entering an amount of money: sending, tipping, splitting a bill, setting a budget.
  • Any amount where floating-point rounding must never creep in; the value is an integer of minor units.

When not to use

  • Numbers that are not money, or that step in fixed amounts. Use Roll Stepper.
  • Picking from a few preset amounts only. Use chips or Choice Cards.

Notes

  • Digits arrive from the right like a till: typing 1, 2, 5, 0 gives 0.01, 0.12, 1.25, 12.50, and every place rolls to its new digit.
  • currency, groupSeparator, decimalSeparator and fractionDigits cover most locales (for example €, . and ,).
  • A transparent native field sits over the amount, so tapping it opens the number pad and screen readers read the formatted amount.
  • With reduced motion digits change in place and new places appear without opening.

Props

MoneyFieldProps

PropTypeDefaultDescription
valuerequirednumber—The amount in minor units: cents for dollars, pence for pounds.
onChangeValuerequired(minor: number) => void—
labelrequiredstring—Names the field for screen readers, e.g. "Amount to send".
currencystring'$'Written before the amount. Defaults to "$".
fractionDigitsnumber2Digits after the decimal separator. Defaults to 2.
groupSeparatorstring','Defaults to ",".
decimalSeparatorstring'.'Defaults to ".".
maxnumber99_999_999Largest amount in minor units. Defaults to 99,999,999 (999,999.99).
hapticsbooleantrueA tick per typed digit. Defaults to true.
textStyleStyleProp<TextStyle>—Style for the amount; the cell widths are measured from it.
testIDstring—
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
Plain text cells, two shared values each; widths are measured once per text style. Only the caret loops, and only while focused.
Measured

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

Real-device measurement pending.

Accessibility

Reduced motion
Digits change in place, new places appear at once and the caret stays lit.
Screen readers
A number field named by its label whose value is the formatted amount.
Touch target
The whole amount is the target, at least 160 by 66 pt.

Source files

components/kinetik/money-field.tsx is in the Code tab of the preview above.