Skip to main content

Currency Input

Enter an amount with its currency, picked from a list in the field, built on Base UI.

View as Markdown

Installation

Component API

PropTypeDefaultDescription
labelstring-Text above the field, wired to it as its accessible name.
Text above the field, wired to it as its accessible name.
descriptionstring-A line under the field.
A line under the field.
errorstring-Marks the field invalid and shows this under it in place of description.
Marks the field invalid and shows this under it in place of description.
valuenumber-
defaultValuenumber-The amount on first render, uncontrolled.
The amount on first render, uncontrolled.
onValueChange(value: number | null) => void-Called with the amount, or null when the field is cleared.
Called with the amount, or null when the field is cleared.
currencystring-
defaultCurrencystringUSDThe currency on first render, uncontrolled.
The currency on first render, uncontrolled.
onCurrencyChange(currency: string) => void-Called with the ISO code when another currency is picked.
Called with the ISO code when another currency is picked.
currenciesstring[]-
localestringen-USFormats the grouping, the decimal mark and the currency names.
Formats the grouping, the decimal mark and the currency names.
sizesm | md | lgmdHeight & width of the field.
Height & width of the field.
shapenone | rounded | pill-
disabledbooleanfalseBlocks the field and the picker and dims both.
Blocks the field and the picker and dims both.
requiredbooleanfalseMarks the field required and adds an asterisk to the label.
Marks the field required and adds an asterisk to the label.
classNamestring-
focusboolean | stringtrue
containerHTMLElement | null-The picker list rendering inside this element instead of the page, for a frame or a container that owns its own stacking context.
The picker list rendering inside this element instead of the page, for a frame or a container that owns its own stacking context.