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 🙏

© 2026 – Pkg Stats / Ryan Hefner

npm-all-routes-button

v1.0.11

Published

A customizable React button for navigating between multiple routes with animations

Readme

npm-all-routes-button

A fully customizable React button for navigating between multiple routes with smooth animations. It supports slide, fade, and zoom effects, allowing developers to create dynamic page transitions.

📦 Installation

Install the package using npm:

npm install npm-all-routes-button

🛠️ Usage

Import the AllRoutesButton component and pass your routes, animations, and styles.

📍 Basic Example

import React from 'react'
import { BrowserRouter as Router } from 'react-router-dom'
import AllRoutesButton from 'npm-all-routes-button'
import './custom-button.css' // Custom styles

const routes = [
  { name: 'Home', path: '/' },
  { name: 'Work', path: '/work' },
  { name: 'About Me', path: '/about-me' },
  { name: 'Contact', path: '/contact' },
  { name: 'Projects', path: '/projects/1' },
]

const customStyles = {
  buttonStyles: { backgroundColor: 'blue', color: 'white', padding: '12px 24px', borderRadius: '8px' },
  buttonHoverStyles: { backgroundColor: 'darkblue', color: 'yellow' },
  overlayStyles: { backgroundColor: 'rgba(0, 0, 0, 0.9)' },
  containerStyles: { padding: '20px', borderRadius: '12px', textAlign: 'center' },
  headerStyles: { color: 'yellow', fontSize: '2rem' },
  linkStyles: { color: 'cyan', fontSize: '1.2rem' },
  linkHoverStyles: { color: 'white', transform: 'scale(1.1)' }
}

function App() {
  return (
    <Router>
      <AllRoutesButton routes={routes} animation="slide-in" styles={customStyles} />
    </Router>
  )
}

export default App

🎨 Customization

You can fully customize the component by passing props for routes, animations, and styles.

🛤 Routes

The routes prop is required and should contain an array of objects with:

  • name: The display name of the route.
  • path: The React Router path.

Example:

const routes = [
  { name: 'Home', path: '/' },
  { name: 'Work', path: '/work' },
  { name: 'About', path: '/about' },
  { name: 'Contact', path: '/contact' },
  { name: 'Projects', path: '/projects/1' },
]

Then pass the routes prop:

<AllRoutesButton routes={routes} animation="zoom-in" />

🎬 Animations

Choose from three built-in animations:
Slide (slide-in, slide-out)
Fade (fade-in, fade-out)
Zoom (zoom-in, zoom-out)

Example:

<AllRoutesButton routes={routes} animation="fade-in" />

Animations automatically reverse when navigating away.


🎨 Styling

You can fully style the button, overlay, and links using the styles prop.

| Prop | Type | Description | |------|------|-------------| | routes | array | List of routes with { name, path } | | animation | string | Animation type (slide-in, fade-in, zoom-in) | | buttonStyles | object | Styles for the button (default: fixed at top-right) | | buttonHoverStyles | object | Styles when hovering over the button | | overlayStyles | object | Styles for the full-screen overlay | | containerStyles | object | Styles for the content container | | headerStyles | object | Styles for the header text | | linkContainerStyles | object | Styles for the list items | | linkStyles | object | Styles for the links inside the menu | | linkHoverStyles | object | Styles for the links on hover |

Example with Custom Styles

const myStyles = {
  buttonStyles: { background: 'black', color: 'white' },
  overlayStyles: { background: 'rgba(255, 0, 0, 0.8)' },
  linkStyles: { color: 'white' },
  linkHoverStyles: { color: 'gold' }
}

<AllRoutesButton routes={routes} animation="zoom-in" styles={myStyles} />

🔄 Fun Feature - Reverse Animation on Navigation

When clicking on a link or the Go Back button, the reverse animation will play before navigating.

Example

If animation="slide-in", it will slide-out when navigating away.


🌟 Why Use This Package?

Full-Screen Overlay with Animations
Customizable Styles via Props
Works with React Router
Supports Reverse Animations
Easy to Use & Lightweight


🛠️ Requirements

  • React 18+
  • React Router 6+

🛠 Development & Contribution

If you’d like to contribute:

Clone the repository:

git clone https://github.com/AminaK2724/npm-all-routes-btn

Navigate to the project directory:

cd all-routes-button

Install dependencies:

npm install

Run the project locally:

npm start

Build the package:

npm run build

Test the package in a sample React project:

cd test-all-routes-button
npm install npm-all-routes-button
npm start

Feel free to fork the repository and submit a pull request if you’d like to contribute! 🚀


📄 License

ISC License © 2025 Amina Khan


Support & Feedback

If you like this package, give it a ⭐ on GitHub!
For issues, report them here.

For any inquiries or feedback, please reach out to:

Amina Khan
[email protected] | GitHub