Component libraryCurrency input
Currency input
ProEnter an exact decimal amount with native forms and locale-aware currency context.
npx shadcn@latest add @tidal-pro/currency-inputInstallation
Pro source is gated. Configure the @tidal-pro registry using the agent guide. Create an access key from your account after purchasing.
Terminal
Import components/ui/tidal.css, components/ui/currency-input.css, then add the component inside a tidal-scope wrapper. Its scoped design tokens keep it independent of your existing CSS.
Usage
Complete example source · Dependency and asset manifest
Loading the complete example…
API & behavior
Controlled exact decimal string value and onValueChange; required currency plus optional locale/currencyDisplay/fraction display bounds. Optional canonical decimal min/max/step use string arithmetic without floating-point conversion; step may be any and bases at min or zero. Native text-input name/form/required/autocomplete/placeholder/handlers/className/style and forwarded ref remain available; type/inputMode/value/defaultValue/min/max/step and disabled/readOnly ARIA are owned. The named visible input serializes the exact canonical string. Locale digits, distinct decimal/group separators, minus and currency tokens normalize to the canonical decimal proposal; a period remains the canonical decimal during direct editing even when it is also the locale grouping token. The visible formatted output uses Intl.NumberFormat while the input retains an editable exact string. Caller onInput/onChange run first and either may prevent a paired proposal. Consumer errors, native invalid attributes, disabled/readOnly and unprevented native reset semantics are preserved. Consumers own state, validation policy beyond exact decimal bounds, form submission and all financial behavior.
Style with the --t-* CSS variables. Set data-theme="dark" on your tidal-scope wrapper for a dark surface. Motion respects the system’s reduced-motion preference.