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

@ausbom/accordion

v0.7.9

Published

> Accordions are a list of sections that allow users to show or hide related content.

Downloads

199

Readme

@ausbom/accordion

Accordions are a list of sections that allow users to show or hide related content.

Try Accordion

Why

Accordions give quick access to options of content that are relevant to them.

When

Use accordions when you want to:

  • Give users options from a list of related items.
  • To shorten the page by condensing content into collapsable sections.
  • Choose between information in one place rather than on seperate pages.

How

Behaviour

Accordions should start with all sections closed. To open a section, select anywhere in the item button.

Users should be in control of the accordion state. If an accordion item is open when another accordion item is selected, then the original accordion item stays open.

Do

  • Always use an accordion for a list of related items.
  • Indicate an open accordion by changing the direction of the chevron (to point up) and the borders of the open accordion are blue.
  • Use the same text style for all accordion headings on a page or in a list.
  • Consider if there are there more appropriate alternatives, such as using In page anchor or showing the content on different pages or tabs.

Do not

  • Use an accordion for a single item.
  • Use accordions for short sections of content. Use simple headings to seperate this content instead.
  • Avoid using accordions to contain complex content such as graphs, tables or anything that might require horizontal scrolling.

Accessibility

Accordions need to be keyboard accessible as list items with a visible focus state.

Screen readers should read aloud all the text in the button as a single statement. There's also some visually hidden content in the heading text to help announce the call-to-action as "collapsed, button" or "expanded, button".

Installation

npm install @ausbom/accordion

API Docs

import Accordion, { AccordionItem } from '@ausbom/accordion'
import React from 'react'

<Accordion>
  <AccordionItem id="accordion-1" title="Lorem ipsum dolor">
    accordion-1 content
  </AccordionItem>
  <AccordionItem
    id="accordion-2"
    isOpen
    title="Lorem ipsum dolor sit amet"
  >
     accordion-2 content
  </AccordionItem>
  <AccordionItem id="accordion-3" title="Lorem ipsum">
     accordion-3 content
  </AccordionItem>
  <AccordionItem id="accordion-4" title="Lorem ipsum dolor">
     accordion-4 content
  </AccordionItem>
  <AccordionItem id="accordion-5" title="Lorem ipsum dolor" subTitle="Lorem ipsum sub title">
     accordion-5 content
  </AccordionItem>
</Accordion>