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

@vysmo/slideshow-react

v0.2.0

Published

React bindings for @vysmo/slideshow — a <Slideshow> component that drives any of the 60 WebGL transitions between slides, with opt-in arrows / dots / counter / progress / captions; useSlideshow hook for imperative control.

Readme

@vysmo/slideshow-react

React bindings for @vysmo/slideshow. Drop-in image slideshow driven by any of the 60 @vysmo/transitions shaders, with opt-in arrows / dots / counter / progress / captions — wrapped in one component plus a hook for imperative control.

Live demos · Source

Install

pnpm add @vysmo/slideshow @vysmo/slideshow-react

react ≥ 18 is a peer dependency. @vysmo/transitions is required if you want to pass a specific transition (dissolve is the default).

Quick start

import { Slideshow } from "@vysmo/slideshow-react";
import { paintBleed } from "@vysmo/transitions";

export function Hero() {
  return (
    <Slideshow
      slides={["/01.jpg", "/02.jpg", "/03.jpg"]}
      transition={paintBleed}
      transitionDuration={900}
      autoplayDelay={4000}
      arrows
      dots
      style={{ width: "100%", aspectRatio: "16 / 9" }}
    />
  );
}

The component renders a <div>, mounts the slideshow into it, and tears down on unmount. Click halves, keyboard nav, and autoplay are wired by default; arrows / dots / counter / progress / captions are opt-in.

Per-slide transition

Pass a function (from, to) => Transition to vary the transition per slide change:

import { paintBleed, glitch, ripple, crossZoom } from "@vysmo/transitions";

const transitions = [paintBleed, glitch, ripple, crossZoom];

<Slideshow
  slides={[...]}
  transition={(from, to) => transitions[to % transitions.length]!}
/>

Imperative control

For custom Next/Prev buttons, scroll-bound go(), autoplay toggles, etc., use the hook and call methods on the returned handle:

import { useRef } from "react";
import { useSlideshow } from "@vysmo/slideshow-react";

function ControlledSlideshow({ slides }) {
  const ref = useRef<HTMLDivElement>(null);
  const slideshow = useSlideshow(ref, { slides, autoplayDelay: 4000 });

  return (
    <>
      <div ref={ref} style={{ width: "100%", aspectRatio: "16 / 9" }} />
      <button onClick={() => slideshow?.prev()}>‹</button>
      <button onClick={() => slideshow?.next()}>›</button>
      <button onClick={() => slideshow?.isPlaying ? slideshow.pause() : slideshow?.play()}>
        Play / Pause
      </button>
    </>
  );
}

The handle is null until the slideshow is mounted; use optional chaining or a guard.

Props

| Prop | Type | Default | Notes | |---|---|---|---| | slides | readonly SlideSource[] | — | URLs (decoded), HTMLImageElements, or canvases. | | initial | number | 0 | Starting index. | | transition | Transition \| (from, to) => Transition | dissolve | Single transition or per-slide selector. | | transitionDuration | number | 800 | Transition ms. | | ease | EasingFn | linear | Easing for the transition. | | autoplayDelay | number | — | Dwell time in ms; omit / 0 to disable. | | autoplay | boolean | true if autoplayDelay > 0 | Start autoplay on mount. | | loop | boolean | true | Wrap last → first. | | clickNavigation | boolean | true | Click halves to advance. | | keyboardNavigation | boolean | true | Arrow keys, Home/End, Space. | | pauseOnHidden | boolean | true | Pause autoplay while the tab is hidden. | | pauseOnHover | boolean | false | Pause autoplay on hover. | | swipeNavigation | boolean \| SwipeOptions | false | Touch / pointer swipe. | | arrows | boolean \| ArrowsOptions | false | Visible nav arrows. | | dots | boolean \| DotsOptions | false | Page-indicator dots. | | counter | boolean \| CounterOptions | false | Slide-counter overlay. | | progress | boolean \| ProgressOptions | false | Autoplay countdown bar. | | captions | false \| CaptionsOptions | false | Per-slide caption overlay. | | ariaLabel | string | "Slideshow" | Accessible label. | | onChange | (current, previous) => void | — | Slide change callback. | | onTransitionStart | (from, to) => void | — | Transition begins. | | onTransitionEnd | (from, to) => void | — | Transition ends. | | className | string | — | Forwarded to the host <div>. | | style | CSSProperties | — | Forwarded to the host <div>. Size the slideshow here. |

SSR

The wrapper is SSR-safe: useEffect bodies don't run on the server, and the module body itself doesn't touch window / document. Server renders an empty <div>; client mounts the slideshow.

License

MIT.