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-sidemenu

v1.1.0

Published

Lightweight customizable React sidemenu component.

Downloads

266

Readme

react-sidemenu

Lightweight side menu component written in React.js. No jQuery, just CSS3.

Features

  • Pure React.js, no external dependencies
  • Configure via JSON or via React components
  • Packed with default ready-to-use styling
  • Easy to customize styling guide
  • Custom rendering, collapse control, right-to-left etc.
  • Flow type checking support

Usage

Install the component with NPM:

npm install react-sidemenu --save

Import the component in your React.js application:

import {SideMenu} from 'react-sidemenu';

Flow

If you want to have access to Flow typed components, include SideMenu.js from dist folder when installing via npm.

Styling!!!

To use default styling include side-menu.css to your project. You can find it in dist folder when installing via npm. For an idea on how to customize styling see Demo.

Demo & Examples

Demo showcasing the functionalities & code examples. We use Font Awesome as a CDN for the example icons to show.

You can run examples by yourself. Clone the repo and do:

npm install
npm start

The examples are run using Webpack development server.

Options

<SideMenu> - main component

|Option|Default|Description| | --- | --- | --- | | items | null | Property for the JSON configuration of the component SideMenu component. Check out Demo to find out how it works. | | activeItem | null | Preset starting active item. Also used for opening and closing menu items from code (e.g. from a button). | | collapse | true | This property gives you the capability to enable or disable collapsing menu when other elements of the menu are clicked. | | theme | 'default' | This sets a class for the component that you can use to apply custom styling. The class will be Side-menu-[theme_name]. Note: our default theme uses Font Awesome icons. See Demo for an detailed example. | | renderMenuItemContent({ icon: icon, value: value, label: label }) | null | This property enables you to provide a custom render method for items. Function is passed one parameter, representing the menu item being rendered. It receives an object with attributes: icon, label and value. Demo| | onMenuItemClick | (value, extras) => window.location.href = '#' + value | This property enables you to provide custom onClick method for items. The function gets passed the value of the clicked item and item extras (object). Demo| | rtl | false | This property enables you to use the sidemenu in a right-to-left page. Demo| | shouldTriggerClickOnParents | false | This property enables triggering 'onMenuItemClick' on parent items that have children. |

<Item> - this component is for the non-JSON config of the menu

|Option|Description| | --- | --- | | value | This is the link where you will be redirected after you click the item or the value attribute inside method onMenuItemClick | | label | This is the representative value of the item | | icon | This is the representative icon of the item. It should be font-awesome class name. | onClick | Custom on click method specific for this item (overrides onMenuItemClick). | extras | Container for additional data. (Not required)

Roadmap

Any contribution is welcome.

To be done:

  • tests & CI support
  • refactor examples code (it's awful, I know)