npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-custom-back-to-top-button

v1.0.2

Published

A react back to top button package

Downloads

103

Readme

react-custom-back-to-top-button

Back to top button package allows you to set a button that can be shaped the way you want and put any icon in it

Install

$ npm i react-custom-back-to-top-button

or

$ yarn add react-custom-back-to-top-button

Dependencies

  • @material-ui/core
  • @material-ui/icons

:exclamation: You do not need to install these two dependencies, they will be installed automatically.

Use

import React, { Fragment } from 'react';
import BackToTop from 'react-custom-back-to-top-button';

const App = () => {
 return (
   <Fragment>
     // Your some code
     <BackToTop/>
   </Fragment>
 );
};

export default App;

Change icon

You can pass the icon you like as props from fontawesome icons.

Example code:

import React, { Fragment } from 'react';
import BackToTop from 'react-custom-back-to-top-button';

const App = () => {
  return (
    <Fragment>
      // Your some code
      <BackToTop icon={<i className='fas fa-sort-up'></i>}/>
    </Fragment>
  );
};

export default App;

To use fontawesome icons, don't forget to add the fontawesome link in the <head> </head> section of your index.html file in the public folder. Add this link if you want:

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">

Props

| Prop | Type | Default | Description
| :----------------------- | :-------: | :------: | :-------------------------------- | showIcon | boolean | true | Show / Hide icon
| icon | element | <KeyboardArrowUpIcon style={{fontSize: 25}}/> | You can use the icon of your choice as shown in the example code. | toShow | number | 300 | To show the button by the value of scrollY

Style

| Prop | Type | Default | Description
| :-------------------: | :-------: | :---------: | :--------------
| fontSize | number | 16 | Sets the size of the text you add to the button.
| width | number | 3rem | Sets the width of the button
| height | number | 3rem | Sets the height of the button
| bottom | number | 45 | Sets how many px the button should go up from the bottom | right | number | 45 | Sets how many px the button should go from the right to the left | left | number | null | Sets how many px the button should go from the left to the right | backgroundColor | string | '#363636' | Sets the background color | color | string | '#fff' | Sets the color of the icon or text inside | borderRadius | number | 100 | Sets the roundness of the border | style | Object | null | Takes the css properties you have created | className | string | null | Takes the class you have specified. Maybe you want to get a more pleasant appearance, for example to give the hover feature