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

svz-accordion

v1.3.2

Published

The SysVisionz Accordion is a one stop shop for both a typical accordion type component and for a special table row pair type accordion.

Downloads

2

Readme

SysVisionz Accordion

This module provides four management classes for saving and retrieving objects, arrays, and all current javascript primitives into a named cookie without issue.

Installation

To install, in terminal type

	npm i --save svz-accordion

then, in your project,

    import Accordion from 'svz-accordion';

Accordion

Accordion is pretty simple, but very versatile.

summary?: ReactElement | string | number | ReactElement[]
This is the original activating element. A tr element will render as a table row, a div will render as that div, any other types will render as a div surrounding the element you provide. Leaving this undefined will make the accordion reliant on a change to the ** open ** prop to make it work.

open?: boolean
This is the value for whether or not the accordion is open. Defaults to false.

onClick?: (evt: MouseEvent | MouseEvent) => void
This is the function that will be run when you click on the activating element.

onToggle?: (open: boolean) => void
This function will trigger any time open is toggled, and provides the new open value as its argument.

keepOpen?: boolean
If this is set to true, open will only be set to false if you click on the activating element. Otherwise, clicking outside the element will close it.

children: ReactElement | string | number
the children for this element will be what is rendered in the expanding component. If this is a tr style element, it will render as a table row and adjusts its styling appropriately so it still works in that format.

openDirection?: 'down' | 'up' | 'left' | 'right'
This is the direction in which the children element will pop. If children is a tr element, only 'down' or 'up' are viable options.

closeOnMouseOut?: boolean
When set to true, the accordion will close if the mouse moves outside of the details element after the first time it has entered the details element.

closeOnClick?: boolean When set to true, the accordion will close if the details section is clicked.

Additionally, the "AccordionRow" version can be used

    import { AccordionRow } from 'svz-accordion';

This is basically an assumed table row format, and the arguments change a little for ease of use.

summary is removed.

children: ReactElement | string | number | ReactElement[]
this element will actually be the original activating element. However, it can also be used in the format of an array of tr elements, which will render the first as the activating row and the second as the row revealed on click.