rohan-currency-flag-selector
Version:
Small React currency selector with country flags
30 lines (26 loc) • 782 B
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
declare const currencyMap: Record<string, {
symbol: string;
currency: string;
country: string;
}>;
interface CurrencySelectorProps {
/**
* initial country code like 'US', 'IN'
*/
initial?: keyof typeof currencyMap;
/**
* callback when user selects a currency
*/
onSelect?: (code: string) => void;
/**
* whether to persist selection to localStorage
*/
persist?: boolean;
/**
* custom className for the trigger button
*/
className?: string;
}
declare function CurrencySelector({ initial, onSelect, persist, className, }: CurrencySelectorProps): react_jsx_runtime.JSX.Element;
export { CurrencySelector, CurrencySelectorProps, currencyMap };