react-exchange-widget

1.0.3 • Public • Published

react-exchange-widget

Customisable currency exchange React widget for https://openexchangerates.org/

Amazing demo

react-exchange-widget

Install

yarn add -D react-exchange-widget

or

npm install --save-dev react-exchange-widget

Usage

import React from 'react';
import ExchangeWidget from 'react-exchange-widget';
 
const serviceApiConfig = {
  appID: 'you-app-id-open-exchange-rates',
};
 
/../
 
render() {
  return (
    <div>
      <ExchangeWidget serviceApiConfig={serviceApiConfig} />
    </div>
  );
}
 

Props

defaultPair: [string, string]

Initial pair

defaultValue: [number, number]

Initial value

serviceApiConfig: { appID: string }

Your AppID in https://openexchangerates.org/

syncAuto: boolean

Enable auto sync of currency rate

syncTimeout: number

Synchronization interval in milliseconds

theme: { background: string, width: string, height: string, textColor: string }

Object to configure a custom theme.

onChange: func({ pair: [string, string], value: [number, number] }) => void

/react-exchange-widget/

    Package Sidebar

    Install

    npm i react-exchange-widget

    Weekly Downloads

    0

    Version

    1.0.3

    License

    MIT

    Last publish

    Collaborators

    • dmalakhov