1.0.5 • Published 2 years ago

sandro-generic-tile10 v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Generic Tile

react-generic-tile is a KPI tiles built for React

Installation

npm install react-generic-tile

or

yarn add react-generic-tile

Demo

CodeSandbox Demo: https://codesandbox.io/s/23yj4zr9w0?expanddevtools=1 npm.io

Example

import React from "react";
import ReactDOM from "react-dom";

import GenericTile from "react-generic-tile";

function App() {
  return (
    <div className="App">
      <GenericTile
        header={"Jessica Daniell"}
        subheader={"Senior Consultant, Department Sales & Distribution"}
        loading={false}
        number={"65.5"}
        scale={"MM"}
        color={"Good"}
        indicator={"Up"}
        footer={"This is only example.."}
        background={"#386dc2"}
        width={"200px"}
        padding={"20px"}
        colorfoot={"#FFF"}
      />
    </div>
  );
}

const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);

Avaible tile props

PropertyTypeDefaultDescription
headerString''Header text
subheaderString''Subheader text
footerString''Footer text
numberString''Displayed number (could be text also)
scaleString''Scale text
indicatorStringnull"Up" or "Down"
iconObject''Icon object
colorString''Hex Color or : "Good", "Warning" or "Bad"
loadingBooleanfalseLoading state