# react-rate-card

> [![npm](https://img.shields.io/npm/v/react-rate-card)](https://www.npmjs.com/package/react-rate-card) [![NPM](https://img.shields.io/npm/l/react-rate-card)](https://www.npmjs.com/package/react-rate-card)

Latest version **1.0.11** (published 2021-11-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install react-rate-card
pnpm add react-rate-card
yarn add react-rate-card
bun add react-rate-card
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.11 |
| Published | 2021-11-02 |
| First published | 2021-11-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 87.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | bmsteven |

## Links

- npm: https://www.npmjs.com/package/react-rate-card
- npm.io page: https://npm.io/package/react-rate-card

## Recent versions

- 1.0.11 (latest) — 2021-11-02
- 1.0.10 — 2021-11-02
- 1.0.9 — 2021-11-02
- 1.0.8 — 2021-11-02
- 1.0.7 — 2021-11-02
- 1.0.6 — 2021-11-02
- 1.0.5 — 2021-11-02
- 1.0.4 — 2021-11-02
- 1.0.3 — 2021-11-02
- 1.0.2 — 2021-11-02
- 1.0.1 — 2021-11-02
- 1.0.0 — 2021-11-02

## README

# react rating card

[![npm](https://img.shields.io/npm/v/react-rate-card)](https://www.npmjs.com/package/react-rate-card) [![NPM](https://img.shields.io/npm/l/react-rate-card)](https://www.npmjs.com/package/react-rate-card)

- [React Rate Card Component](#react-rate-card)
  - [Features](#features)
  - [Installation](#Installation)
  - [Usage](#usage)
  - [Examples](#examples)
  - [Props](#props)

## Features

- Converts rates bewteen coins and currencies
- Written in TypeScript and has type support
- Requires `antd` and `axios` to work

## Installation

`npm install react-rate-card`

or

`yarn add react-rate-card`

## Usage

```js
...
import RateCard from 'react-rate-card';

<RateCard
  coins={["coin"]} // array of coins
  currencies={["currencier"]} // array of currencies
  defaultSelected="coin" // default selected coin
  currencylayer_access_key="http://apilayer.net/api/live api key"
  coinslayer_access_key="http://api.coinlayer.com/api/live api key"
  customStyles={{...styles}} // style props for the rate card
  customClass="className" // classname to style the rate card
  inputClass="classname" // classname to style inputs
  inputStyle={{...styles}} // style props for inputs
  currencyStyle={{...styles}} // style props for currencies section
  currencyClass="classname" // classname to style currencies section
  errorStyle={{...styles}} // style props to for error message
  errorClass="classname" // classname to style error message
/>
```

## Examples

[Source code](https://github.com/bmsteven/react-rate-card/tree/main/example)  
[Demo](https://react-rate-card.netlify.app)

## Props

| Name                     | Type                  | Default                                | Description                                              |
| ------------------------ | --------------------- | -------------------------------------- | -------------------------------------------------------- |
| coins                    | `array`               | `["XLM", "USDT"]`                      | Array of coins                                           |
| currencies               | `array`               | `["XLM", "USDT", "KES", "RWF", "TZS"]` | Array of currencies                                      |
| defaultSelected          | `string`              | `XLM`                                  | Default selected coin                                    |
| currencylayer_access_key | `string`              | `null`                                 | http://apilayer.net/api/live api key **(Required)**      |
| coinslayer_access_key    | `string`              | `null`                                 | http://api.coinlayer.com/api/live api key **(Required)** |
| customStyle              | `React.CSSProperties` | `null`                                 | Style props for the rate card                            |
| customClass              | `string`              | `null`                                 | Classname to style the rate card                         |
| inputClass               | `string`              | `null`                                 | Classname to style inputs                                |
| inputStyle               | `React.CSSProperties` | `null`                                 | Style props for inputs                                   |
| currencyStyle            | `React.CSSProperties` | `null`                                 | Style props for currencies section                       |
| currencyClass            | `string`              | `null`                                 | Classname to style currencies section                    |
| errorStyle               | `React.CSSProperties` | `null`                                 | Style props to for error message                         |
| errorClass               | `string`              | `null`                                 | Classname to style error message                         |

---
_Source: https://npm.io/package/react-rate-card · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
