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

@jessemc98/motion-menu

v1.0.1

Published

Requires `react` as a peer dependency, only dependency is `react-motion`, if you think this should also be a peer dependency please open an issue on github.

Readme

Installation

Requires react as a peer dependency, only dependency is react-motion, if you think this should also be a peer dependency please open an issue on github.

npm i @jessemc98/motion-menu

Demos

To see working demos navigate to the 'demo' folder and run the following command.

npm i && npm start

which downloads all dependencies and runs a development server with multiple demos, open http://localhost:3000 to view it in the browser.

Importing

// using es6 imports
import MotionMenu from '@jessemc98/motion-menu'
import { SpacedMotionMenu } from '@jessemc98/motion-menu'

// using require syntax
var motion = require('@jessemc98/motion-menu')
var MotionMenu = motion.default
var SpacedMotionMenu = motion.SpacedMotionMenu

API Reference

<MotionMenu />

Usage

<MotionMenu
  btns={[
    {iconSrc: './myIcon.svg', alt: 'icon', onClick: () => null},
    {iconSrc: './myIcon.svg', alt: 'icon'}
    ]} />

Props

- btns: Buttons

Required. An array of button types to be shown in the menu. The Button type is an object with the following structure:

{
  iconSrc: String matching the src of the icon for the button,
  alt: String which is used as the alternative text for the button icon,
  onClick: Function which is called when the button is clicked
}
- angle?: Angle

Optional. The angle between each of the buttons in the menu in degrees.

  • Default: 30
- angleOffset?: Angle Offset

Optional. The angle to offset the buttons in degrees. The offset is counted anti-clockwise starting from a bearing of 0. E.g. if you gave angleOffset={90} the buttons center would be pointing left.

- btnRadius?: Small Button Radius

Optional. The radius of the smaller, menu buttons in px.

  • Default: 25
- mainBtnRadius?: Main Button Radius

Optional. The radius of the open/close button in px.

  • Default: 35
- spaceBetween?: Space Between

Optional. The amount of margin/space between the main button and the small buttons in px.

  • Default: 40
- springConfig?: Spring Configuration

Optional. An Object of the following structure:

{
  open: {stiffness: NUM, damping: NUM},
  close: {stiffness: NUM, damping: NUM}
}

MotionMenu uses react-motion behind the scenes, the springConfig prop uses the same structure as react-motion's spring config. You can learn more about the details of this config object here

  • Default:
{
  open: {stiffness: 550, damping: 29},
  close: {stiffness: 200, damping: 20}
}

<SpacedMotionMenu />

Usage

<SpacedMotionMenu
  btns={[
    {iconSrc: './myIcon.svg', alt: 'icon', onClick: () => null},
    {iconSrc: './myIcon.svg', alt: 'icon'}
    ]} />

Props

The SpacedMotionMenu component takes the same props as the MotionMenu component, the main difference is, that the SpacedMotionMenu does not take an angle prop. Instead it calculates an angle where, with the given props.btns, every button would be evenly spaced around the main button.

E.g given btns={[{},{},{},{}]} it would render a MotionMenu component with the angle prop set to 90 in order to evenly space the 4 buttons.

development

After installation navigate to the installation directory and run the following command to run a test suite using facebooks jest.

npm test

The following command builds a commonJs module at libs/index.js

npm run build

The following command builds an es harmony module at libs/es6.js

npm run build:es