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

@impulse-ui-native/carousel

v6.3.0

Published

Native snapping carousel with centered previews and themed navigation.

Readme

@impulse-ui-native/carousel

Finite, horizontal native carousels for iOS and Android. Each child is one slide.

Installation

pnpm add @impulse-ui-native/carousel @impulse-ui-native/theme react-native-svg

Requires React >=18, React Native >=0.73, react-native-svg >=13.9 and a ThemeProvider. Load the theme's Montserrat fonts in your host application. No Reanimated or Gesture Handler setup is required by this package.

Usage

import { Image, StyleSheet } from "react-native";

import { Carousel } from "@impulse-ui-native/carousel";
import { ThemeProvider } from "@impulse-ui-native/theme";

const styles = StyleSheet.create({ image: { width: "100%", height: "100%" } });

export function Gallery() {
  return (
    <ThemeProvider>
      <Carousel peek={32} defaultIndex={1}>
        <Image
          key="lake"
          source={{ uri: "https://example.com/lake.jpg" }}
          style={styles.image}
        />
        <Image
          key="coast"
          source={{ uri: "https://example.com/coast.jpg" }}
          style={styles.image}
        />
        <Image
          key="mountain"
          source={{ uri: "https://example.com/mountain.jpg" }}
          style={styles.image}
        />
      </Carousel>
    </ThemeProvider>
  );
}

Public API

Exports: Carousel, CarouselProps, CarouselPagination. Also re-exported by @impulse-ui-native/toolkit.

| Prop | Default | Behavior | | ------------------------------------------ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | index / defaultIndex / onIndexChange | uncontrolled, 0 | Zero-based slide index. Swipe requests fire when scrolling settles; navigation requests fire on press. Controlled changes require the parent to update index. | | pagination | "dots" | "dots", "segments", "counter", or "none". Dots and segments fall back to a counter when their tap targets cannot fit. | | showNavigation | true | Previous/next medium filled IconButtons; their disabled state follows the nearest slide. | | peek | 0 | Neighbor preview width at the first and last slides. Middle slides divide the available space equally between both sides. The theme supplies the gap; preview space is bounded to half the viewport. | | slideAspectRatio | 16 / 9 | Uniform slide sizing. Fill the child surface or compose content within it. | | disabled | false | Blocks swipes, navigation, and indicators. Child content remains consumer-owned. |

Root props extend the library's ViewProps. No scroll-view implementation props or infinite looping are exposed. Children are mounted eagerly: use modest slide counts, stable keys and appropriately sized images rather than large data feeds.

State and motion

  • With peek, the first slide snaps to the left edge, middle slides snap to the center with previews on both sides, and the final slide snaps to the right edge with a preview of the previous slide on the left.
  • Pagination and navigation buttons follow the nearest slide during scrolling, switching halfway between neighboring snap positions for both swipes and animated navigation.
  • Swipe commits the nearest logical index once native scrolling settles. A parent that declines a controlled change keeps its index and the viewport returns to it.
  • Invalid indices are clamped for display. Changing the slide count or viewport size realigns the viewport; supply a valid index when updating controlled data. A clamp caused by removing slides does not emit onIndexChange.

Theme

Carousel geometry and indicator colors live in components.carousel and are created by createCarouselTokens. Navigation consumes the existing iconButton tokens without local button overrides. Customize through ThemeProvider components, including callback overrides derived from the theme.

The default dark scheme currently shares the light palette. The dark Storybook example uses explicit primitive color overrides, as shown in the approved design.

Verification

Exercise Storybook on iOS and Android to validate snapping, resizing, preview bounds, centered alignment, midpoint transitions, empty/invalid indices, and native gestures.