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

@slidev-polls/component

v0.3.0

Published

Slidev addon that renders live poll results on-slide.

Readme

@slidev-polls/component

Slidev addon that renders live audience-poll results on-slide, backed by the slidev-polls backend.

Install

npm install @slidev-polls/component
# or
bun add @slidev-polls/component

Enable in your deck

In slides.md frontmatter:

---
addons:
  - "@slidev-polls/component"
# Backend URL the addon hits for SSE, activation, and deck-token auth.
# Omit if the deck is served same-origin with the backend.
pollServer: https://polls.example.com
---

The addon reads pollServer via useSlideContext().$slidev.configs. Override per-slide by adding pollServer: to that slide's own frontmatter block.

Alternative (programmatic) — set the backend once from a Slidev setup/main.ts or data.ts:

import { configureDeckAuthBackend } from "@slidev-polls/component";

configureDeckAuthBackend("https://polls.example.com");

Frontmatter wins when both are set.

It also mounts a sign-in button in the Slidev nav bar for deck-token auth (paste the token minted in the backoffice → toolbar flips to signed in: ).

Embed poll results on a slide

Don't hand-author the markup. Open the backoffice question editor → Copy snippet → paste into the slide. The snippet pre-fills slug, pollId, questionId:

<PollResults
  slug="my-talk"
  pollId="78a7aa06-68ea-498e-b1a8-f9faba8bcb2c"
  questionId="4cc12084-d866-44e1-ad86-d012d9511ba8"
/>

On mount, when the presenter is signed in, PollResults POSTs /api/deck/polls/{pollId}/activate to make this question the live one. Anonymous viewers see the same tallies but never trigger activation.

QR code overlay

While signed in as a presenter, every <PollResults> rendered on a slide shows a small QR-toggle button in its top-right corner. Clicking it opens a fullscreen overlay with a styled rounded-dot QR code (rendered locally via qr-code-styling, nothing leaves the browser) plus the printed voter URL — ${pollServer || window.location.origin}/${slug} — so the audience can scan to join without typing. Click the backdrop, the close button, or press Escape to dismiss. The button is hidden when the deck is not signed in.

Peer dependencies

  • @slidev/client ^52.0.0
  • vue ^3.5

(Tested against Slidev 52.15.x.)

License

GPL-3.0-or-later. See LICENSE.

Reading poll results from other slides

PollResults keeps a deck-wide reactive cache of every poll it has seen, keyed by an author-chosen name. Tag each panel with a short, human-readable name and read it back from any other slide:

<PollResults slug="my-talk" pollId="…" questionId="…" name="q1" />
<PollResults slug="my-talk" pollId="…" questionId="…" name="q2" />
<script setup>
import { computed } from "vue";
import { usePollResults } from "@slidev-polls/component";

const q1 = usePollResults("q1");
const q2 = usePollResults("q2");

const totals = computed(() => {
  const out: Record<string, number> = {};
  for (const snap of [q1.value, q2.value]) {
    for (const t of snap?.tally ?? []) out[t.optionId] = (out[t.optionId] ?? 0) + t.count;
  }
  return out;
});
</script>

<template>
  <ul>
    <li v-for="(count, id) in totals" :key="id">{{ id }}: {{ count }}</li>
  </ul>
</template>

If you omit name, the panel registers under its slug (or slug::questionId when several questions share a slug) — handy for one-off lookups, but a name keeps aggregator slides free of UUIDs.

The cache is mirrored to localStorage (slidev-polls:results-cache), so the last-known tally is available immediately on slide nav before the SSE stream re-opens. The store only contains polls whose PollResults component has mounted at least once in the current browser; there is no eager pre-fetch.