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

@tsogtoodev/bongo

v1.0.0

Published

Animated theme switcher for Vue 3 and Nuxt — light/dark/system themes with GIF and View Transition effects.

Readme

Bongo 🥁

Animated theme switcher for Vue 3 and Nuxt — light/dark/system themes with GIF-masked and View Transition reveals.

  • 🌗 Light · dark · system with live OS-preference tracking, persistence and cross-tab sync
  • 🎞️ GIF transitions — the new theme revealed through a preloaded, cached GIF's alpha mask
  • 🌀 View Transition reveals — circle, rectangle, polygon, blur; feature detected with instant fallback
  • 🧩 Composable-first — use the component, the composable, or your own UI
  • 🖥️ SSR-safe — no browser APIs on the server, anti-flash inline script, optional Nuxt layer
  • ♿ Accessible — native button semantics, ARIA state, prefers-reduced-motion respected everywhere
  • 🌲 Library-grade — ESM + CJS, typed, tree-shakeable, vue as the only peer dependency

Installation

npm install @tsogtoodev/bongo

Vue 3

// main.ts
import { createApp } from 'vue'
import { createBongo } from '@tsogtoodev/bongo'
import App from './App.vue'

const app = createApp(App)
app.use(createBongo({
  defaultTheme: 'system',
  attribute: 'class',              // <html class="dark"> (or 'data-theme')
  // circle defaults to start: 'origin' — it grows from the clicked element
  transition: { type: 'view', variant: 'circle' },
}))
app.mount('#app')
<script setup lang="ts">
import { BongoThemeToggle, useBongoTheme } from '@tsogtoodev/bongo'

const { theme, resolvedTheme, setTheme, toggleTheme } = useBongoTheme()
</script>

<template>
  <!-- default toggle -->
  <BongoThemeToggle />

  <!-- GIF mask transition -->
  <BongoThemeToggle transition="gif" gif-src="/theme-transition.gif" />

  <!-- or fully custom UI -->
  <button @click="toggleTheme()">{{ resolvedTheme }}</button>
</template>

Optional default button styling: import '@tsogtoodev/bongo/styles.css'.

Prevent the SSR theme flash

import { bongoInitScript } from '@tsogtoodev/bongo'
// inject into <head> with your framework's head mechanism:
const script = bongoInitScript({ defaultTheme: 'system' })

Nuxt

// plugins/bongo.ts
import { createBongoNuxtPlugin } from '@tsogtoodev/bongo/nuxt'

export default defineNuxtPlugin(
  createBongoNuxtPlugin({ defaultTheme: 'system' }),
)
// app.vue — anti-flash head script
import { bongoHeadScript } from '@tsogtoodev/bongo/nuxt'
useHead({ script: [bongoHeadScript({ defaultTheme: 'system' })] })

The Nuxt layer is a thin wrapper over the core Vue plugin: it defers browser init until after hydration (no hydration mismatches) and never touches browser APIs on the server. The core package does not depend on Nuxt.

API sketch

const {
  theme,          // 'light' | 'dark' | 'system' (writable)
  resolvedTheme,  // 'light' | 'dark'
  systemTheme,    // OS preference
  isDark,
  setTheme,       // setTheme('dark', { transition, trigger })
  toggleTheme,
  controller,     // framework-independent controller
} = useBongoTheme()

Transitions can be configured app-wide, per component, or per call:

toggleTheme({ transition: { type: 'gif', src: '/party.gif' } })
setTheme('dark', { transition: { type: 'view', variant: 'rectangle', start: 'bottom-up' } })
toggleTheme({ transition: false }) // instant

Full documentation lives in docs/ — run npm run docs:dev for the interactive playground.

Development

npm install            # library deps
npm run test           # vitest
npm run typecheck      # vue-tsc
npm run lint           # eslint
npm run build          # dist/ (ESM + CJS + d.ts + styles)

cd docs && npm install # docs deps (links the library via file:..)
npm run docs:dev       # playground / docs site
npm run docs:build

License

MIT