Enter an amount with its currency, picked from a list in the field, built on Base UI.
View as MarkdownInstallation
Component API
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | - | Text above the field, wired to it as its accessible name. |
| Text above the field, wired to it as its accessible name. | |||
description | string | - | A line under the field. |
| A line under the field. | |||
error | string | - | 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. | |||
value | number | - | |
defaultValue | number | - | 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. | |||
currency | string | - | |
defaultCurrency | string | USD | The 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. | |||
currencies | string[] | - | |
locale | string | en-US | Formats the grouping, the decimal mark and the currency names. |
| Formats the grouping, the decimal mark and the currency names. | |||
size | sm | md | lg | md | Height & width of the field. |
| Height & width of the field. | |||
shape | none | rounded | pill | - | |
disabled | boolean | false | Blocks the field and the picker and dims both. |
| Blocks the field and the picker and dims both. | |||
required | boolean | false | Marks the field required and adds an asterisk to the label. |
| Marks the field required and adds an asterisk to the label. | |||
className | string | - | |
focus | boolean | string | true | |
container | HTMLElement | 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. | |||