Skip to content
caliper ui docs

Pro

Money field

A currency amount field with a currency picker and quick-add steps.

Pro
pnpm dlx shadcn@latest add @caliper/money-field

Pay Inês Carvalho

INV-0388 · illustration retainer for October

Inês CarvalhoFreelance · Lisbon · paid 6 times

Up to 1,000 per payment.

Installs components/ui/money-field.tsxDepends on @radix-ui/react-popover, lucide-reactMotion none in component source

When to use

Use it for

  • Payments, budgets and invoices where the amount and currency go together.
  • You want min and max limits with clear feedback.

Skip it when

  • The value is a plain number; use a number field.
  • The currency is fixed and invisible; use a number input with a suffix.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/money-field

Adds its 5 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.

Usage

Import it from your copy of the source. The example behind the preview comes with the source.

example.tsx
import { MoneyField } from "@/components/ui/money-field"

The worked example comes with Pro

The 29-line example behind the preview opens here, ready to copy.

  • 626 Pro parts, blocks and page templates, all with source
  • $149 once, with lifetime updates. No renewal
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

MoneyField

component
PropTypeDefault
label *string—
valuenumber | null—
defaultValuenumber | nullnull
currency"USD" | "EUR" | "GBP" | "JPY"—
defaultCurrency"USD" | "EUR" | "GBP" | "JPY""USD"
currenciesreadonly ("USD" | "EUR" | "GBP" | "JPY")[]["USD", "EUR", "GBP", "JPY"]
minnumber—
maxnumber—
quickAddreadonly number[][10, 50]
disabledboolean—
namestring—
idstring—
descriptionstring—
onValueChange((value: number | null, details: MoneyDetails) => void)—
onCurrencyChange((currency: "USD" | "EUR" | "GBP" | "JPY") => void)—
classNamestring—

Accessibility

It exposes spinbutton and status semantics, with aria-label, aria-hidden, aria-valuenow, aria-valuemin, aria-valuemax and aria-valuetext kept in step with state. Changes that matter are announced through a live region.

KeyBehaviour
↑Moves to the previous item or value.
PageUpMoves by a larger step, or to the previous page.
↓Moves to the next item or value.
PageDownMoves by a larger step, or to the next page.

Motion

It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.

All Money and phone examples