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

magicmove

v0.1.0

Published

React View Transitions Library - Apple Keynote-style Magic Move animations for the web

Readme

MagicMove

A lightweight React library that brings Apple Keynote's famous Magic Move transitions to the web using the native View Transitions API.

Features

  • 🪄 Automatic animations - Elements with matching IDs animate smoothly between states
  • 📦 Zero CSS dependencies - Uses native View Transitions API
  • 🎯 Simple API - Just wrap your elements with MagicMove
  • 🚀 Native performance - Hardware-accelerated animations
  • 🔧 TypeScript ready - Full type definitions included
  • Tiny bundle - Minimal footprint

Installation

npm install magicmove
# or
yarn add magicmove
# or
pnpm add magicmove

Quick Start

import { MagicMoveProvider, MagicMove, useMagicMove } from 'magicmove';

function App() {
  return (
    <MagicMoveProvider>
      <MyComponent />
    </MagicMoveProvider>
  );
}

function MyComponent() {
  const { trigger } = useMagicMove();
  const [expanded, setExpanded] = useState(false);

  return (
    <MagicMove 
      id="my-card" 
      className={expanded ? 'w-full h-96' : 'w-48 h-32'}
    >
      <button onClick={() => trigger(() => setExpanded(!expanded))}>
        {expanded ? 'Collapse' : 'Expand'}
      </button>
    </MagicMove>
  );
}

API Reference

<MagicMoveProvider>

Wrap your app with this provider to enable MagicMove functionality.

<MagicMoveProvider 
  duration={300}           // Animation duration in ms (default: 300)
  easing="ease-out"        // CSS easing function (default: cubic-bezier(0.4, 0, 0.2, 1))
>
  <App />
</MagicMoveProvider>

<MagicMove>

The core component for enabling view transitions on any element.

<MagicMove
  id="unique-id"           // Required: Unique identifier
  as="div"                 // HTML element type (default: 'div')
  layoutId="shared-id"     // Optional: For shared element transitions
  className="..."          // Standard React props supported
  style={{...}}
>
  {children}
</MagicMove>

<MagicMoveImage>

Specialized component for images with view transitions.

<MagicMoveImage
  id="hero-image"
  src="/image.jpg"
  alt="Description"
  className="w-full h-64 object-cover"
/>

<MagicMoveList>

Component for animating list reordering.

<MagicMoveList
  items={items}
  getKey={(item) => item.id}
  renderItem={(item) => <ListItem item={item} />}
  transitionPrefix="list-item"    // Optional prefix for transition names
  as="ul"                         // Container element type
/>

useMagicMove()

Hook for triggering view transitions.

const { trigger, isAnimating } = useMagicMove();

// Wrap state updates to animate them
trigger(() => {
  setState(newValue);
});

// Disable interactions during animation
<button disabled={isAnimating}>Click me</button>

triggerMagicMove()

Standalone function for one-off transitions (no provider required).

import { triggerMagicMove } from 'magicmove';

triggerMagicMove(
  () => router.push('/new-page'),
  { duration: 400, easing: 'ease-out' }
);

Examples

Check out the examples/nextjs folder for live examples:

  • Master-Detail - List to detail view with shared element transitions
  • Table ↔ Grid - Toggle between table and grid layouts
  • Card Expand - Expandable cards with smooth zoom animations
  • Image Gallery - Photo gallery with lightbox transitions
  • Layout Animation - Elements animate to new positions
  • List Reordering - Shuffle and reverse lists with animations
  • Tabs - Animated tab switching
  • Text Transitions - Headlines, quotes, and content transitions

Running Examples

# From the root directory
cd examples/nextjs
npm install
npm run dev

Browser Support

MagicMove uses the View Transitions API. Currently supported in:

  • Chrome 111+
  • Edge 111+
  • Opera 97+
  • Chrome for Android 111+

For unsupported browsers, animations gracefully degrade - state updates happen immediately without transitions.

Development

# Install dependencies
npm install

# Build the library
npm run build

# Watch mode for development
npm run dev

License

MIT