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

@imccc/theme-ripple

v1.1.7

Published

Smooth theme transitions for Vue and React using View Transition API

Readme

theme-ripple

npm version License: MIT Live Demo

Smooth theme transitions for Vue and React using the View Transition API.

Live Demo

Demo Demo

✨ Features

  • 🎨 Smooth Animations - Beautiful circular/directional transitions powered by View Transition API
  • ⚛️ Vue & React - First-class support for both frameworks
  • 🧭 8 Directions - Animate from any edge or corner
  • 🎛️ Customizable - Control duration, easing, and animation origin
  • 🌐 System Theme - Auto-detect and sync with OS theme preference
  • 📦 Lightweight - No dependencies, tree-shakeable

📦 Installation

# npm
npm install @imccc/theme-ripple

# pnpm
pnpm add @imccc/theme-ripple

# yarn
yarn add @imccc/theme-ripple

🚀 Quick Start

Vue

<script setup lang="ts">
import { ref } from 'vue'
import { useThemeRipple } from '@imccc/theme-ripple/vue'

const isDark = ref(false)

const { toggleTheme, isTransitioning, isSupported } = useThemeRipple(
  isDark,
  (dark) => {
    isDark.value = dark
    document.documentElement.classList.toggle('dark', dark)
  },
  true // sync with system theme
)

const handleClick = (event: MouseEvent) => {
  toggleTheme({
    x: event.clientX,
    y: event.clientY,
    duration: 400,
    animation: 'ease-out'
  })
}
</script>

<template>
  <button @click="handleClick" :disabled="isTransitioning">
    Toggle Theme {{ isSupported ? '(Animated)' : '(Instant)' }}
  </button>
</template>

React

import { useState, useCallback } from 'react'
import { useThemeRipple } from '@imccc/theme-ripple/react'

function App() {
  const [isDark, setIsDarkState] = useState(false)

  const setIsDark = useCallback((dark: boolean) => {
    setIsDarkState(dark)
    document.documentElement.classList.toggle('dark', dark)
  }, [])

  const { toggleTheme, isTransitioning, isSupported } = useThemeRipple(isDark, setIsDark, true)

  const handleClick = (event: React.MouseEvent) => {
    toggleTheme({
      x: event.clientX,
      y: event.clientY,
      duration: 400,
      animation: 'ease-out'
    })
  }

  return (
    <button onClick={handleClick} disabled={isTransitioning}>
      Toggle Theme {isSupported ? '(Animated)' : '(Instant)'}
    </button>
  )
}

📖 API Reference

useThemeRipple(isDark, setIsDark, isAutoChangeTheme?)

| Parameter | Type | Description | |-----------|------|-------------| | isDark | Ref<boolean> (Vue) / boolean (React) | Current dark mode state | | setIsDark | (dark: boolean) => void | Function to update dark mode state | | isAutoChangeTheme | boolean | Auto-sync with system theme (default: true) |

Returns:

| Property | Type | Description | |----------|------|-------------| | toggleTheme | (options) => void | Function to trigger theme transition | | isTransitioning | Ref<boolean> (Vue) / boolean (React) | Whether a transition is in progress | | isSupported | Ref<boolean> (Vue) / boolean (React) | Whether the browser supports View Transition API |

toggleTheme(options)

| Option | Type | Default | Description | |--------|------|---------|-------------| | x | number | - | X coordinate of animation origin | | y | number | - | Y coordinate of animation origin | | duration | number | 400 | Animation duration in ms | | animation | string | 'ease-in' | CSS easing function | | direction | Direction | - | Preset direction (overrides x/y) |

Direction Options

| Value | Description | |-------|-------------| | 'top' | Expand from top center | | 'bottom' | Expand from bottom center | | 'left' | Expand from left center | | 'right' | Expand from right center | | 'top-left' | Expand from top-left corner | | 'top-right' | Expand from top-right corner | | 'bottom-left' | Expand from bottom-left corner | | 'bottom-right' | Expand from bottom-right corner |

🌐 Browser Support

This library uses the View Transition API. For unsupported browsers, the theme will change immediately without animation.

📄 License

MIT © ImChrisChen