1.0.3 • Published 7 years ago

react-exchange-widget v1.0.3

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

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