New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-native-carousel-lite

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-carousel-lite

Lightweight, high-performance React Native carousel built with core components. Zero dependencies, smooth animations, and easy integration.

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

Lightweight, zero-dependency React Native carousel component. Fast, customizable slider with autoplay, infinite loop, and pagination—built with ScrollView for iOS and Android.

npm version license

react-native-carousel-lite is a minimal, high-performance carousel for React Native with no third-party dependencies. Use it as a lightweight alternative to heavier carousel libraries when you need a simple, fast slider or image carousel with snap scrolling, optional autoplay, and full TypeScript support.

Table of contents

forthebadge forthebadge

✨ Preview

react-native-carousel-lite horizontal carousel demo on iOS and Android

react-native-carousel-lite carousel with image slides and pagination

Best React Native carousel for small bundles. Many carousels depend on reanimated, gesture handlers, or native modules. This one uses only the built-in ScrollView with pagingEnabled, so you get a zero-dependency carousel that stays fast and predictable on iOS and Android. Ideal when you need a lightweight carousel or snap carousel without extra native setup.

⚡ Features

  • Zero dependencies — Pure React Native; no carousel or gesture libraries
  • High performance — ScrollView-based; no reanimated or native modules
  • Smooth snap scrolling — Page-by-page with configurable deceleration
  • Autoplay & infinite loop — Configurable interval; optional looping
  • Cross-platform — Works on iOS and Android
  • Fully customizable — Styles and custom dot renderer for pagination
  • Controlled or uncontrolledindex / onIndexChange or internal state
  • Ref APIscrollToIndex, scrollToNext, scrollToPrev, getCurrentIndex
  • Tappable pagination dots — Tap a dot to jump to that page; custom renderDot receives onPress
  • Accessibility — Configurable labels and roles
  • Windowed rendering — Optional windowSize for large lists

📦 Installation

Install the package from npm:

npm install react-native-carousel-lite

Or with Yarn:

yarn add react-native-carousel-lite

Peer dependencies: React >=17.0.0, React Native >=0.64.0. No native linking required.

🚀 Usage

Import the carousel, pass your data and renderItem. Pagination dots are shown by default.

import { Carousel } from 'react-native-carousel-lite';
import { Text, View } from 'react-native';

const data = [{ id: '1', title: 'Slide 1' }, { id: '2', title: 'Slide 2' }];

<Carousel
  data={data}
  renderItem={({ item }) => <Text>{item.title}</Text>}
  keyExtractor={(item) => item.id}
  itemsPerPage={2}
  autoPlay
  autoPlayInterval={3000}
  loop
  onIndexChange={(index) => console.log(index)}
/>

Scroll control with ref

Use a ref to scroll to a specific slide or next/prev (e.g. from buttons).

const ref = useRef<CarouselRef>(null);

<Carousel ref={ref} data={data} renderItem={...} />

// Later:
ref.current?.scrollToIndex(2, true);
ref.current?.scrollToNext(true);
ref.current?.scrollToPrev(true);
ref.current?.getCurrentIndex();

Controlled index

Control the current page from parent state (e.g. sync with tabs or URL).

const [index, setIndex] = useState(0);
<Carousel
  data={data}
  index={index}
  onIndexChange={setIndex}
  renderItem={...}
/>

Use vertical for vertical scrolling and renderDot for custom pagination UI.

<Carousel
  data={data}
  vertical
  renderItem={...}
  renderDot={({ index, isActive, onPress }) => (
    <Pressable onPress={onPress} style={[styles.dot, isActive && styles.dotActive]} />
  )}
/>

📋 Props

PropTypeDefaultDescription
dataT[]requiredArray of items to display in the carousel.
renderItem(params) => ReactNoderequiredRenders each item; receives { item, index }.
itemsPerPagenumber1Number of items per page (stacked in scroll direction).
autoPlaybooleanfalseWhen true, advances to the next page at autoPlayInterval.
autoPlayIntervalnumber5000Auto-advance interval in milliseconds.
autoPlayPauseOnDragbooleantruePauses autoplay while the user is dragging.
keyExtractor(item, index) => stringindexReturns a stable key for each item.
indexnumberControlled current page index (use with onIndexChange).
defaultIndexnumber0Initial page when using uncontrolled mode.
onIndexChange(index) => voidCalled when the visible page index changes.
loopbooleanfalseEnables infinite looping (duplicates first/last page).
verticalbooleanfalseWhen true, scrolls vertically instead of horizontally.
decelerationRate'fast' | 'normal' | number'fast'Scroll deceleration for snappier feel.
containerStyleViewStyleStyle for the outer container.
contentContainerStyleViewStyleStyle for the ScrollView content container.
pageStyleViewStyleStyle for each page wrapper.
showDotsbooleantrueWhether to show pagination dots.
renderDot({ index, isActive, onPress }) => ReactNodeCustom dot renderer; receives onPress to scroll to that page. Overrides default dot styles when set.
dotsContainerStyleViewStyleStyle for the dots container.
dotStyleViewStyleStyle for inactive dots.
activeDotStyleViewStyleStyle for the active dot.
windowSizenumber0Render only pages within active ± N (0 = render all). Use for large lists.
accessibilityLabelstring'Carousel'Accessibility label for the carousel.
dotsAccessibilityLabelstring'Page indicator'Accessibility label for the pagination.

❓ Frequently asked questions

How do I install a carousel in React Native?
Run npm install react-native-carousel-lite, then import Carousel and pass data and renderItem. No native linking or extra setup.

Is this carousel zero dependency?
Yes. It only uses React Native’s built-in ScrollView. No reanimated, gesture handler, or other carousel libraries.

Does it work on iOS and Android?
Yes. It’s built with core React Native components and works on both platforms.

Can I use it as an alternative to other similar carousel libraries?
Yes. If you want a lighter, ScrollView-based carousel without extra native modules, this is a good fit. Use the ref API for programmatic scrolling and the props table above for full options.

📄 License

MIT © Anshul Thakur 2026

Keywords

react-native

FAQs

Package last updated on 18 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts