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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@gemeente-denhaag/accordion

v4.0.2

Published

An Accordion component.

Downloads

1,704

Readme

Accordion

An accordion is a vertically stacked list of headers that reveal or hide associated sections of content.

When to use

An accordion is used to:

  • Organize related information.
  • Shorten pages and reduce scrolling when content is not crucial to read in full.
  • When space is at a premium and long content cannot be displayed all at once, like on a mobile interface or in a side panel.

Alternatives and related components

None.

Anatomy

The accordion consists of:

  1. Title: contains the section title and is control for revealing the panel.
  2. Icon: indicates if the panel is open or closed.
  3. Panel: the section of content associated with an accordion header.
  4. Container

(Interactive) states

The accordion contains the states inactive, active, hover, disabled and focus.

Design properties

Typography

  • Title inactive: TheSans/md/400
  • Title active: TheSans/md/700
  • Panel: TheSans/md/400

Color

  • Title: text color Grey/4
  • Icon: svg color Grey/4
  • Panel: text color Grey/4
  • Container: border color Grey/2

Interactive states

  • Active: title text color Blue/3, icon svg color Blue/3
  • Hover: title text color Blue/3, icon svg color Blue/3
  • Disabled: title text color Grey/2, icon svg color Grey/2
  • Focus: title text color Grey/4, icon svg color Grey/4, container border color Ocher/5

Structure

  • Title inactive: padding-top and padding-bottom 12px, height 48px
  • Title active: padding top and padding-bottom 16px
  • Title: margin-left 16px
  • Icon: height and width 24px, padding-right 16px
  • Panel: padding-right 16px
  • Container: border 1px

Accessibility

Availability of accordion content to assistive technology requires the use of aria-controls and toggling aria-expanded as regions are expanded and collapsed.

Content guidelines

Title

Accordion titles should:

  • Be clear because it hides content
  • Be as brief as possible while still being clear and descriptive.

If you struggle to come up with clear titles, it might be because the way you’ve separated the content is not clear.

Panel

Content inside of a section may be split into paragraphs and include sub-headers if needed.

Best practices

Dos

Accordions should:

  • Have an overview of multiple, related sections of content.
  • Show and hide those sections as needed.
  • Open as many panels as needed.

Don’ts

Accordions should:

  • Not be used if you can keep the content on a single page.
  • Not be used to split up a series of questions into sections.
  • Not hide content which is essential to all users.

References

https://design-system.service.gov.uk/components/accordion/ https://www.nngroup.com/articles/accordions-complex-content/