UNPKG

@tiller-ds/data-display

Version:

Data display module of Tiller Design System

20 lines (19 loc) 963 B
/// <reference types="react" /> export declare type AmountProps = { /** * Defines the amount style for the desired number. * The component formats the look of the number accordingly. */ amountStyle?: "currency" | "decimal" | "percent" | "unit" | undefined; /** * Data handed to the component in a valid string format or a number format. * Other props come from Intl.NumberFormatOptions (https://bit.ly/3yHqaPz) */ children: number | string; /** * Changes the display of the currency by applying various representations of currency displays. * For example, 'usd' currency can be represented with '$', 'US dollars', or 'USD'. */ currencyDisplay?: "symbol" | "code" | "name" | "narrowSymbol"; } & Omit<Intl.NumberFormatOptions, "localeMatcher" | "style" | "currencyDisplay">; export default function Amount({ children, amountStyle, ...props }: AmountProps): JSX.Element | null;