TidalUI

Currency input preview

Enter an exact decimal amount with native forms and locale-aware currency context.

pro · Forms · primitive

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/currency-input

Import components/ui/tidal.css, components/ui/currency-input.css. Wrap installed components in tidal-scope.

Preview

Currency input component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/currency-input.css";
import{TidalCurrencyInput}from"./components/ui/currency-input";
export default()=><div className="tidal-scope"><TidalCurrencyInput currency={"value"} label={"Demo"} onValueChange={() => {}} value={"value"}/></div>;

API and props

TidalCurrencyInput.currency (required)
string

Required currency value accepted by this exported component.

TidalCurrencyInput.label (required)
ReactNode

Required label value accepted by this exported component.

TidalCurrencyInput.onValueChange (required)
(value: string) => void

Callback invoked when the value change interaction is proposed.

TidalCurrencyInput.value (required)
string

Required value value accepted by this exported component.

TidalCurrencyInput.aria-disabled
Booleanish | undefined

Accessible disabled supplied by the consumer.

TidalCurrencyInput.aria-invalid
boolean | "true" | "false" | "grammar" | "spelling" | undefined

Accessible invalid supplied by the consumer.

TidalCurrencyInput.currencyDisplay
"symbol" | "name" | "code" | "narrowSymbol" | undefined

Optional currency display value accepted by this exported component.

TidalCurrencyInput.description
ReactNode

Optional description value accepted by this exported component.

TidalCurrencyInput.disabled
boolean | undefined

Optional disabled value accepted by this exported component.

TidalCurrencyInput.error
ReactNode

Optional error value accepted by this exported component.

TidalCurrencyInput.locale
string | undefined

Optional locale value accepted by this exported component.

TidalCurrencyInput.max
string | undefined

Optional max value accepted by this exported component.

TidalCurrencyInput.maximumFractionDigits
number | undefined

Optional maximum fraction digits value accepted by this exported component.

TidalCurrencyInput.min
string | undefined

Optional min value accepted by this exported component.

TidalCurrencyInput.minimumFractionDigits
number | undefined

Optional minimum fraction digits value accepted by this exported component.

TidalCurrencyInput.onChange
ChangeEventHandler<HTMLInputElement, HTMLInputElement> | undefined

Callback invoked when the change interaction is proposed.

TidalCurrencyInput.onInput
InputEventHandler<HTMLInputElement> | undefined

Callback invoked when the input interaction is proposed.

TidalCurrencyInput.readOnly
boolean | undefined

Optional read only value accepted by this exported component.

TidalCurrencyInput.rootClassName
string | undefined

Optional root class name value accepted by this exported component.

TidalCurrencyInput.step
string | undefined

Optional step value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas