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-3d-model-carousel

v1.0.0

Published

A React Native library for rendering interactive 3D GLB models in a smooth, customizable carousel powered by Three.js

Downloads

211

Readme

react-native-3d-model-carousel

A React Native library for rendering interactive 3D .glb/.gltf models in a simple carousel with previous/next controls and optional swipe navigation.

Preview

Installation

npm install react-native-3d-model-carousel @react-three/fiber @react-three/drei three

If you use Expo, also install expo-gl.

Usage

import { ModelCarousel } from 'react-native-3d-model-carousel';
import { Pressable, Text } from 'react-native';

import Car1 from './assets/Car1.glb';
import Car2 from './assets/Car2.glb';
import Car3 from './assets/Car3.glb';

export default function App() {
  return (
    <ModelCarousel
      models={[
        {
          path: Car1,
          scale: 1.1,
          position: [0, -3, 0],
          cameraPosition: [0, 7, 6],
        },
        {
          path: Car2,
          scale: 1.5,
          position: [0, -2.4, 0],
          cameraPosition: [0, 6, 5],
        },
        Car3,
      ]}
      width="100%"
      height="100%"
      scale={1.3}
      position={[0, -3, 0]}
      cameraPosition={[0, 8, 6]}
      fov={40}
      autoRotate
      autoRotateSpeed={5}
      autoPlay
      autoPlayInterval={3000}
      containerStyle={{ backgroundColor: '#f0f0f0' }}
      renderPrevButton={({ onPress, disabled }) => (
        <Pressable onPress={onPress} disabled={disabled}>
          <Text>Prev</Text>
        </Pressable>
      )}
      renderNextButton={({ onPress, disabled }) => (
        <Pressable onPress={onPress} disabled={disabled}>
          <Text>Next</Text>
        </Pressable>
      )}
    />
  );
}

TypeScript asset declarations

If your app does not already declare 3D asset modules, add this to a *.d.ts file:

declare module '*.glb' {
  const content: any;
  export default content;
}

declare module '*.gltf' {
  const content: any;
  export default content;
}

Props

| Prop | Type | Default | Description | | ------------------ | ---------------------- | -------------- | -------------------------------------------------- | | models | ModelCarouselItem[] | - | Array of model assets or per-model config objects. | | width | DimensionValue | '100%' | Carousel container width. | | height | DimensionValue | '100%' | Carousel container height. | | containerStyle | StyleProp<ViewStyle> | undefined | Additional wrapper style. | | scale | number | 0.8 | Model scale. | | position | number[] | [0, -2.7, 0] | Model XYZ position. | | cameraPosition | number[] | [0, 9, 5] | Camera XYZ position. | | fov | number | 35 | Camera field of view. | | autoRotate | boolean | true | Enables model auto-rotation. | | autoRotateSpeed | number | 10 | Auto-rotation speed. | | autoPlay | boolean | false | Automatically advances to the next model in an infinite loop. | | autoPlayInterval | number | 2500 | Delay in milliseconds between each automatic model change. | | enableSwipeNavigation | boolean | true | Enables horizontal swipe to switch models and disables model panning. | | swipeThreshold | number | 36 | Minimum horizontal drag distance (px) required to trigger swipe navigation. | | showPaginationDots | boolean | true | Shows bottom dots indicating total models and current active model. | | showDefaultButtons | boolean | false | Shows built-in previous/next buttons when custom buttons are not provided. | | renderPrevButton | (props) => ReactNode | undefined | Custom previous button renderer. | | renderNextButton | (props) => ReactNode | undefined | Custom next button renderer. |

ModelCarouselItem can be either:

type ModelCarouselItem =
  | unknown
  | {
      path: unknown;
      scale?: number;
      position?: number[];
      cameraPosition?: number[];
    };

When a model item includes scale, position, or cameraPosition, those values override the global props for that specific model only.

renderPrevButton and renderNextButton receive:

type NavigationButtonRenderProps = {
  onPress: () => void;
  disabled: boolean;
  index: number;
  total: number;
  isAnimating: boolean;
};

Contributing

License

MIT


Made with create-react-native-library