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

react-native-pure-carousel

v2.0.0

Published

Pure JS image carousel with animated pagination and a full-screen modal viewer for React Native

Readme

react-native-pure-carousel

Pure JavaScript image carousel for React Native and Expo with an animated pagination indicator and a full-screen, zoomable modal viewer. No native code of its own, so it runs in Expo Go, on web, and on the New Architecture.

Installation

yarn add react-native-pure-carousel react-native-safe-area-context

or

npm install react-native-pure-carousel react-native-safe-area-context

react-native-safe-area-context is a peer dependency used by the full-screen viewer to keep the close button clear of the status bar. Expo projects can install it with npx expo install react-native-safe-area-context.

Requirements: React 19+, React Native 0.78+ (Expo SDK 53+).

Usage

import PureCarousel from 'react-native-pure-carousel';

const images = [1070, 1059, 1025].map((id) => ({
  source: { uri: `https://picsum.photos/id/${id}/720/480` },
  // Optional higher resolution image for the full-screen viewer
  originalSource: { uri: `https://picsum.photos/id/${id}/1280/720` },
}));

export default function Gallery() {
  return <PureCarousel images={images} height={240} />;
}

Pressing an image opens the full-screen viewer. Closing the viewer scrolls the carousel to the image that was being viewed.

Controlling the carousel

import { useRef } from 'react';
import PureCarousel, { type PureCarouselRef } from 'react-native-pure-carousel';

function Gallery() {
  const ref = useRef<PureCarouselRef>(null);

  return (
    <>
      <PureCarousel ref={ref} images={images} onChangeIndex={console.log} />
      <Button title="Next" onPress={() => ref.current?.goNext()} />
    </>
  );
}

Props

All View props are accepted in addition to the following.

| Prop | Type | Default | Description | | ------------------ | --------------------------------------- | ------------ | ----------------------------------------------------------------- | | images | PureImageProps[] | required | Image props per slide plus an optional originalSource. | | width | number | window width | Width of one slide. | | height | number | 260 | Height of the carousel. | | initialIndex | number | 0 | Slide shown first. | | imageConfigs | Partial<PureImageProps> | | Props applied to every image, overridden by per-image props. | | preferOriginal | boolean | false | Render originalSource in the carousel itself when available. | | showPagination | boolean | true | Show the pagination indicator below the slides. | | paginationProps | Partial<PaginationProps> | | Customise the built-in indicator (see below). | | renderPagination | (props: PaginationProps) => ReactNode | | Render your own indicator. | | disableModal | boolean | false | Do not open the full-screen viewer on press. | | onImagePress | (index: number) => void | | Called when a slide is pressed. | | onChangeIndex | (index: number) => void | | Called when the active slide changes. | | ref | Ref<PureCarouselRef> | | Exposes goNext(), goPrev() and goToIndex(index, animated?). |

Pagination props

| Prop | Type | Default | | --------------------------- | -------------------- | ----------- | | mode | 'line' \| 'circle' | 'line' | | circleSize | number | 8 | | lineWidth | number | full width | | lineHeight | number | 2 | | gutterSize | number | 4 | | itemBackgroundColor | string | '#e2e8f0' | | itemActiveBackgroundColor | string | '#334155' |

Pagination is also exported on its own for use with custom lists. It needs horizontalAnimatedScrollPosition (an Animated.Value driven by the list's horizontal scroll offset), itemsCount and containerWidth.

Other exports

  • PureCarouselBase: the carousel without the modal viewer.
  • PureModalViewer: the full-screen viewer, controlled through a ref with openModal(index) and closeModal().
  • Types: PureCarouselProps, PureCarouselRef, PureImageProps, PaginationProps, PaginationMode, PureModalViewerRef.

Contributing

License

MIT