CurrencyField
Formats a numeric value as a localised currency amount.
Installation
pnpm dlx shadcn@latest add @chelone/currency-fieldFormats a numeric value as a localised currency amount.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| cellClassName | string | — | A class name to apply to the cell element when used inside `<DataTable>`. |
| className | string | — | A class name to apply to the root element. |
| currency | string | — | ISO-4217 currency code (e.g. 'USD'). Required when value is a plain number. |
| displayLocale | string | — | Override the user's app locale. |
| empty | ReactNode | — | The node to display when the field value is empty. Defaults to nothing. A string is translated; a ReactNode renders as-is. |
| headerClassName | string | — | A class name to apply to the header cell element when used inside `<DataTable>`. |
| label | ReactNode | — | Label to use as column header when using `<DataTable>` or `<SimpleShowLayout>`. Defaults to the capitalized field name. Set to `false` to disable the label. |
| options | NumberFormatOptions | — | Extra options forwarded to `Intl.NumberFormat`. |
| record | RecordType | — | The record to render. Defaults to the ambient `RecordContext` value. |
| resource | string | — | The resource name. Defaults to the ambient `ResourceContext` value. |
| sortable | boolean | — | Disable the header click handler when used inside `<DataTable>`. |
| sortBy | string | — | The field to sort by when this column head is clicked, if sortable. |
| sortByOrder | SortOrder | — | The order used for sorting when this column head is clicked, if sortable. |
| source | string | — | Name of the property to display (dot/bracket path). |
| storeAsMinorUnits | boolean | — | Treat the stored value as minor units (cents) and divide by 100. |
| textAlign | TextAlign | — | The text alignment for the cell content, when used inside `<DataTable>`. |