Skip to content
caliper ui pro docs

Amount pad

Amount entry in the style of a payments app: the figure is the screen. Each digit rises into place, the figure shrinks to fit as it grows, and a key that would break the amount (a third decimal, over the limit) shakes it instead of being refused silently.

Pro
$0Balance $1,240.00

When to use

  • Sending, requesting or topping up money on phones and kiosks.
  • Any single amount that deserves the whole screen: a tip, a pledge, a budget.

When not to use

  • Forms with several fields; use `MoneyField`.
  • Desktop flows where people type amounts with a full keyboard anyway.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/amount-pad

Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

AmountPad

7 props

Also accepts the native props of its root element and a ref.

PropTypeDefaultDescription
valuestring—The amount as typed, e.g. "12.5". Leave it out to let the pad keep its own.
defaultValuestring"0"
onValueChange((value: string, amount: number) => void)—
maxnumber—Largest amount allowed; going over shakes the figure and keeps the last good value.
currencystring"$"
labelstring"Amount"Names the amount for assistive technology.
hintReactNode—A line under the figure, such as a balance or a limit.

nextAmount

0 props

No props of its own; it accepts the native props of its root element.

Keyboard

Backspace
Removes the previous character or item.
Delete
Removes the next character or the selected item.

Accessibility

It exposes group semantics, with aria-label, aria-hidden and aria-live kept in step with state. Changes that matter are announced through a live region.

Motion

  • State changes animate with the library's shared durations and curves, so its timing matches every other part.
  • Under reduced motion each change lands on its end state without movement; nothing is hidden or skipped.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/amount-pad.md

The index of every part is at /llms.txt.

More in Changing values