FSAI Design System
Components

CurrencyInput

Money-specific input for formatted currency entry with label and error support.

Overview

CurrencyInput is the shared-ui money field used when the user is entering an amount rather than arbitrary numeric text.

It wraps react-currency-input-field and composes:

  • Label
  • formatted currency entry
  • FieldError

Use it when the value is a monetary amount and should be displayed and edited with currency formatting rather than as a plain number.

Basic Usage

import { CurrencyInput } from '@fsai/shared-ui';

<CurrencyInput
  label="Default Price"
  value={value}
  onChange={setValue}
  onBlur={handleBlur}
/>

Props

PropTypeDefaultDescription
valuenumber | string | nullCurrent amount.
onChange(value?: string | null) => voidRequired change handler. Receives the raw numeric string value from the formatter.
prefixstring'$'Currency prefix shown in the field.
placeholderstring'1000'Placeholder when the field is empty.
disabledbooleanDisables the field.
classNamestringAdditional input classes.
onBlur() => voidBlur handler for form integration or save-on-blur flows.
errorstringInline validation message rendered with FieldError.
labelstringOptional field label rendered with Label.

Behavior

CurrencyInput is configured for standard currency entry:

  • formatted on blur
  • decimals allowed
  • maximum two decimal places
  • full-width field styling matching other form controls

The emitted value is the numeric string from the formatter, so parent code is responsible for parsing or storing it in the desired shape.

Brand Dashboard Usage Patterns

Representative usages:

PatternPathNotes
Menu item price fieldfsai/apps/brand-dashboard/src/modules/menu/components/CreateMenuItemModal/CreateMenuItemModal.tsxCanonical labeled form-field usage with react-hook-form and validation errors.
Deal fee editingfsai/apps/brand-dashboard/src/modules/deals/components/DealOverviewFees.tsxUses CurrencyInput as the money branch of a typed fee editor alongside percentage input.
State compliance amount fieldsfsai/apps/brand-dashboard/src/components/StateCompliancePanel/StateCompliancePanelDetails/StateCompliancePanelDetails.components.tsxCompact inline money entry inside a larger details workflow.
Catalog pricingfsai/apps/brand-dashboard/src/modules/menu/components/CatalogItemAssignmentDetail/CatalogItemAssignmentDetail.tsxMoney editing inside menu/catalog detail flows.

Important Conventions

  • Use CurrencyInput for money, not for generic numeric entry.
  • onChange receives a numeric string value, not a parsed number.
  • The default prefix is $, but the component allows overriding it when another currency symbol is needed.
  • CurrencyInput already includes label and error composition, so it usually fits where Input would otherwise be used for a money field.

Guidelines

  • Do use CurrencyInput when the field represents a monetary amount
  • Do pair it with external validation when the amount is required or bounded
  • Do use plain Input type="number" when the value is numeric but not currency
  • Don't use CurrencyInput for percentages, counts, or arbitrary decimals

On this page