Skip to content
GitHub (opens in a new tab)

CurrencyInput

A money amount with a currency symbol, locale formatting, min, max, and step.

stableMoleculecontracts/currencyinput.json

Preview

CurrencyInput

A money amount. The symbol and grouping follow the currency and locale. Step defaults to 0.01.

Master

USD by default. The symbol sits beside the number and is not part of the typed value.

Usage

Wrap with Field. A plain number is NumberInput. Pair a Select when the person chooses the currency code. Do not prefix an Input with a currency character.

Do's

  • A price, amount, or balance in a form
  • The symbol and grouping should follow a currency and locale

Don'ts

  • A plain number — use NumberInput
  • A currency code the person picks from a list — pair Select with CurrencyInput, do not invent a combined control
<Field label="Amount" htmlFor="amount"><CurrencyInput id="amount" currency="USD" /></Field>

When to use

  • A price, amount, or balance in a form
  • The symbol and grouping should follow a currency and locale

When not to use

  • A plain number — use NumberInput
  • A currency code the person picks from a list — pair Select with CurrencyInput, do not invent a combined control

What an agent reads

import { CurrencyInput } from "agentic-ds-kit";
must
  • Same spinbutton behaviour as NumberInput
  • The currency symbol is decorative; aria-valuetext is the formatted number
  • Must have a Field label or ariaLabel
defaults
  • currency USD
  • size md
  • step 0.01
  • disabled false
  • error false
  • steppers true
stops if
  • Do not prefix an Input with a currency character
  • Do not use NumberInput for money
  • Do not use raw hex

From contracts/currencyinput.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
idstringYes——
currencystringNoUSDISO 4217 code.
sizemd | sm | lgNomd—
valuenumber | nullNo—Controlled. null is empty.
defaultValuenumber | nullNo——
onChangefunctionNo—(value: number | null) => void
minnumberNo——
maxnumberNo——
stepnumberNo0.01—
localestringNo——
placeholderstringNo——
disabledbooleanNofalse—
errorbooleanNofalse—
namestringNo——
describedBystringNo——
ariaLabelstringNo——
steppersbooleanNotrue—
  • Component
    →

    NumberInput

    A number the person can type, step, and read in their locale, with optional min and max.

  • Component
    →

    Select

    Choose one or several options from a list.

  • Component
    →

    TaskBrief

    The brief a person hands an agent before it plans: a goal, one-line "done when" checks, optional spend, time and step limits, allowed tools, model and check-in level.

  • Pattern
    →

    Billing schedule

    Next charge, a failed-payment notice, and every charge with its status.