1.1.1 • Published 4 years ago

react-floating-button v1.1.1

Weekly downloads
79
License
MIT
Repository
github
Last release
4 years ago

An Awesome & Unique Customizable Floating Button

Build & Run

Demo

Live demo: https://floating-button.namokrane.works/

Screenshots

Install

With npm

npm install react-floating-button

With yarn

yarn add react-floating-button

Usage

import { FloatingButton, Item } from "react-floating-button";
import downloadIcon from "./assets/DOWNLOAD.svg";
import forwardIcon from "./assets/FORWARD.svg";

<FloatingButton>
  <Item
    imgSrc={downloadIcon}
    onClick={() => {
      console.log("callback function here");
    }}
  />
  <Item
    imgSrc={forwardIcon}
    onClick={() => {
      console.log("callback function here");
    }}
  />
</FloatingButton>;

Options

FloatingButton

PropertyDescriptionTypeDefault
rightSpecify if the button should be on the right if false the button will be at the leftbooleantrue
topSpecify if the button should be on the right if false the button will be at the leftbooleanfalse
sizeThe size used for the buttonsnumber60
backgroundColorThe backgroundColor for the main buttonstring#8f1d30
colorThe color for the main buttonstring#dbdbdb

Item

PropertyDescriptionTypeDefault
imgSrcThe icon to use on given buttonstring-
backgroundColorThe backgroundColor for the Itemstring#dbdbdb
onClickCalled when an item is clickedfunc-

Attribution

Contributing to The Project

Contributing to the project is a piece of :cake:, read the contributing guidelines. You can discuss the project using the issues section. To add a line create an issue and send a pull request, see how to send a pull request.

License

The code is available under the MIT license.