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

@surstromming/accordion

v0.1.0

Published

Collapsible sections.

Downloads

80

Readme

@surstromming/accordion

Collapsible sections. Data-driven: pass items, get the whole accordion.

Dependency graph

graph LR
  accordion["@surstromming/accordion"]
  design["@surstromming/design"]
  icon["@surstromming/icon"]
  accordion --> design
  accordion --> icon

Usage

<template>
  <Accordion v-model="open" :items="items" />

  <!-- markup instead of plain text: a slot named after the value -->
  <Accordion v-model="open" :items="items" multiple>
    <template #shipping>
      Ships in <strong>2–3 days</strong>.
    </template>
  </Accordion>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { Accordion, type AccordionItem } from '@surstromming/accordion'

const open = ref(['refunds'])
const items: AccordionItem[] = [
  { title: 'Is it refundable?', value: 'refunds', content: 'Yes, within 30 days.' },
  { title: 'How fast is shipping?', value: 'shipping' },
]
</script>

Props

| Prop | Type | Default | Notes | | ---------- | ----------------- | ------------ | ----------------------------------------- | | v-model | string[] | [] | The open values | | items | AccordionItem[] | — (required) | { title, value, content?, disabled? } | | multiple | boolean | false | Allow several open at once |

The model is a string[] in both modes — single-open just replaces the array instead of appending. One value type, so switching multiple on doesn't change the shape of your state.

Slots

One optional slot per item, named after its value — it replaces that item's content when you need markup rather than text.

Anatomy

div.root
  └─ div.item
       ├─ h3 > button.trigger   // title + chevron; aria-expanded
       └─ div.content           // grid 0fr → 1fr
            └─ div.contentInner // overflow: hidden

The height animation

grid-template-rows: 0fr → 1fr on the content, with overflow: hidden on the inner div. The section animates to the content's real height with no scrollHeight measuring, no ResizeObserver, and no re-measure when the content changes. Honours prefers-reduced-motion.

Tokens

border divider per item, muted-foreground body and chevron, radius(sm) focus ring (3px ring), 0.875rem type.

Accessibility

Each trigger is a real <button> inside an <h3> (so headings navigation works) carrying aria-expanded. Enter/Space toggle it natively.