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

@rozie-ui/embla-react

v0.1.6

Published

Idiomatic React carousel wrapping Embla Carousel — one Rozie source compiled to React.

Readme

@rozie-ui/embla-react

Idiomatic react Carousel — a cross-framework carousel compiled from one Rozie source wrapping Embla Carousel (v8). The current snap is two-way bound via selectedIndex; slides come as a slides config array or as default-slot DOM. This package is generated; do not edit src/ by hand.

Declarative-mode slides must carry class="rozie-embla__slide". The component pins Embla's slides option to that exact selector, so unclassed default-slot children are not measured as slides.

Install

npm i @rozie-ui/embla-react

Peer dependencies: the embla-carousel (^8.6) + embla-carousel-autoplay (^8.6) engine packages + react + react-dom. Install them alongside this package.

No engine CSS to import — the carousel skeleton styles (overflow: hidden viewport, flex container, slide sizing) ship scoped inside the component.

Usage

import { useState } from 'react';
import { Carousel } from '@rozie-ui/embla-react';

export function Demo() {
  const [index, setIndex] = useState(0);
  return (
    <Carousel
      slides={['A', 'B', 'C']}
      selectedIndex={index}
      onSelectedIndexChange={setIndex}
      loop
      onSelect={(i) => console.log('snap', i)}
    />
  );
}

Props

| Name | Type | Default | Two-way (model) | Required | | --- | --- | --- | :---: | :---: | | slides | Array | [] | | | | loop | Boolean | false | | | | align | String | "center" | | | | axis | String | "x" | | | | slidesToScroll | Number | 1 | | | | dragFree | Boolean | false | | | | draggable | Boolean | true | | | | containScroll | String | "trimSnaps" | | | | startIndex | Number | 0 | | | | skipSnaps | Boolean | false | | | | duration | Number | 25 | | | | direction | String | "ltr" | | | | autoplay | Boolean | false | | | | autoplayDelay | Number | 4000 | | | | dots | Boolean | false | | | | arrows | Boolean | false | | | | thumbnails | Boolean | false | | | | plugins | Array | [] | | | | options | Object | {} | | | | selectedIndex | Number | 0 | ✓ | |

Events

| Event | Payload | Description | | --- | --- | --- | | select | index: number | Fires on every snap change (drag, scroll, or programmatic). Distinct from the selectedIndex model prop — a model prop must not share a name with an emit. | | settle | — | Fires when carousel motion stops (after a drag, scroll, or reInit settles). | | reInit | — | Fires when the engine re-initialises (an option flip, a slide add/remove, or a manual reInitCarousel() call). The current snap is preserved across it. | | pointer-down | — | Fires when a pointer drag begins on the viewport. |

Imperative handle

Beyond props, the component exposes imperative methods (declared once in the Rozie source via $expose). Grab a handle with the native ref mechanism and call them directly:

import { useRef } from 'react';
import { Carousel, type CarouselHandle } from '@rozie-ui/embla-react';

const carousel = useRef<CarouselHandle>(null);
// <Carousel ref={carousel} ... />
carousel.current?.scrollNext();
const i = carousel.current?.getSelectedIndex();

| Method | Description | | --- | --- | | scrollNext | Scroll to the next snap — scrollNext(jump?) (jump skips the transition). No-op before mount. | | scrollPrev | Scroll to the previous snap — scrollPrev(jump?). No-op before mount. | | scrollToIndex | Scroll to a specific snap index — scrollToIndex(index, jump?) (Embla scrollTo). Named to avoid the inherited DOM HTMLElement.scrollTo(x, y). No-op before mount. | | reInitCarousel | Re-initialise the Embla engine (recompute snaps) — reInitCarousel(opts?). Pass raw EmblaOptionsType to override; omit to re-apply the current prop-derived options. (NOT reInit, which is the emitted event.) | | canScrollNext | Return whether a next snap is reachable — canScrollNext(). False before mount. | | canScrollPrev | Return whether a previous snap is reachable — canScrollPrev(). False before mount. | | getSelectedIndex | Return the current scroll-snap index — getSelectedIndex() (Embla selectedScrollSnap()). 0 before mount. (NOT selectedIndex, which is the two-way model prop.) | | scrollSnapList | Return the snap-point progress array — scrollSnapList() (numbers in [0, 1]). Empty before mount. | | scrollProgress | Return the overall scroll progress in [0, 1] — scrollProgress() — to drive a custom progress bar / scrollbar thumb. 0 before mount. | | slidesInView | Return the indices of slides currently in view — slidesInView() — for lazy-loading or highlighting in-view dots. Empty before mount. | | slidesNotInView | Return the indices of slides currently out of view — slidesNotInView() — to unload heavy off-screen content. Empty before mount. | | previousScrollSnap | Return the previously selected snap index — previousScrollSnap() — to compute transition direction. 0 before mount. | | getPlugins | Return the live plugin API map — getPlugins() (e.g. getPlugins().autoplay?.play()/.stop()) for imperative autoplay pause/resume. (NOT plugins, which is a prop.) Null before mount. | | getInstance | Return the underlying EmblaCarouselType instance for direct API access (the engine escape hatch). Null before mount. |

Slots

| Slot | Params | | --- | --- | | slide | slide, index | | (default) | | | thumb | slide, index |