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

@manufosela/behaviour-accordion

v2.0.0

Published

Accessible accordion web component with smooth animations

Readme

@manufosela/behaviour-accordion

Accessible accordion web component built with Lit 3. Features smooth animations, keyboard navigation, and flexible configuration.

Installation

npm install @manufosela/behaviour-accordion

Usage

<script type="module">
  import '@manufosela/behaviour-accordion';
</script>

<behaviour-accordion>
  <accordion-item header="Section 1">
    Content for section 1...
  </accordion-item>
  <accordion-item header="Section 2">
    Content for section 2...
  </accordion-item>
</behaviour-accordion>

Examples

Basic Usage

<behaviour-accordion>
  <accordion-item header="FAQ Question 1">
    Answer to question 1...
  </accordion-item>
  <accordion-item header="FAQ Question 2">
    Answer to question 2...
  </accordion-item>
</behaviour-accordion>

Multiple Open

<behaviour-accordion multiple>
  <accordion-item header="Section A">Content A</accordion-item>
  <accordion-item header="Section B">Content B</accordion-item>
</behaviour-accordion>

Initially Expanded

<behaviour-accordion expanded="0,2">
  <accordion-item header="Open">First and third open</accordion-item>
  <accordion-item header="Closed">This is closed</accordion-item>
  <accordion-item header="Open">Also open</accordion-item>
</behaviour-accordion>

Custom Header Slot

<accordion-item>
  <span slot="header">
    <strong>Custom Header</strong> with rich content
  </span>
  Panel content...
</accordion-item>

Disabled Item

<accordion-item header="Disabled Section" disabled>
  This content is not accessible.
</accordion-item>

Properties

behaviour-accordion

| Property | Type | Default | Description | |----------|------|---------|-------------| | multiple | Boolean | false | Allow multiple items open | | expanded | Array | [] | Indices of expanded items |

accordion-item

| Property | Type | Default | Description | |----------|------|---------|-------------| | header | String | '' | Header text | | expanded | Boolean | false | Whether item is expanded | | disabled | Boolean | false | Whether item is disabled |

Methods

| Method | Description | |--------|-------------| | expand(index) | Expand item at index | | collapse(index) | Collapse item at index | | toggle(index) | Toggle item at index | | expandAll() | Expand all (multiple mode only) | | collapseAll() | Collapse all items |

Events

behaviour-accordion

| Event | Detail | Description | |-------|--------|-------------| | item-toggle | {index, expanded, expandedItems} | Item was toggled |

accordion-item

| Event | Detail | Description | |-------|--------|-------------| | toggle | {expanded} | Item toggle requested |

Slots

accordion-item

| Slot | Description | |------|-------------| | header | Custom header content | | (default) | Panel content |

CSS Custom Properties

| Property | Default | Description | |----------|---------|-------------| | --accordion-border | #e5e7eb | Border color | | --accordion-radius | 8px | Border radius | | --accordion-header-bg | #f9fafb | Header background | | --accordion-header-hover | #f3f4f6 | Header hover background | | --accordion-header-text | #1f2937 | Header text color | | --accordion-header-padding | 1rem | Header padding | | --accordion-content-bg | #fff | Content background | | --accordion-content-text | #4b5563 | Content text color | | --accordion-content-padding | 1rem | Content padding | | --accordion-icon | #6b7280 | Icon color | | --accordion-focus | #3b82f6 | Focus outline color | | --accordion-max-height | 1000px | Max height for animation |

Accessibility

  • Full keyboard navigation (Enter/Space to toggle)
  • ARIA attributes (role, aria-expanded, aria-disabled)
  • Focus management and visible focus indicators
  • Screen reader compatible

License

Apache-2.0