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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-dynamic-banner-carousel

v1.1.3

Published

Cross-platform dynamic banner carousel for React Native and React Web

Readme

📘 react-native-dynamic-banner-carousel

A cross-platform, highly customizable, auto-playing banner carousel component for React Native and React Web (React.js) using a single NPM package.

This library provides:

Smooth autoplay sliding Fully customizable dot indicators Shimmer loading placeholder (React Native) Gradient loader using react-native-linear-gradient Touch handling Works in React Native and React Web with zero changes

The package automatically loads:

index.native.js → for React Native index.js → for React Web (React.js, Vite, Next.js)

✨ Features ✔ Cross-Platform (React Native + Web)

One package, two platforms, automatically selected by the bundler.

✔ Shimmer Loader (React Native)

Smooth skeleton shimmer while images load.

✔ Smooth Autoplay

Automatically slides with customizable intervals.

✔ Custom Dot Indicators

Control size, color, spacing, and active styles.

✔ Touch Support (React Native)

Tap on banners to trigger callback actions.

✔ Responsive Layout

Web version auto-detects screen width. RN version uses the Dimensions API.

📦 Installation React Native Installation

Install the library and peer dependencies:

npm install react-native-dynamic-banner-carousel npm install pinar react-native-linear-gradient react-native-shimmer-placeholder

Run iOS pods (if needed) cd ios && pod install && cd ..

React Web Installation

Just install the package:

npm install react-native-dynamic-banner-carousel

⚠️ Tailwind CSS Setup (Web Only)

If you use this package inside a Tailwind Web project (Vite, React.js, Next.js), you MUST allow Tailwind to scan the package files.

Add this to tailwind.config.js:

module.exports = { content: [ "./index.html", "./src//*.{js,jsx,ts,tsx}", "./node_modules/react-native-dynamic-banner-carousel//*.{js,jsx}", ], theme: { extend: {}, }, plugins: [], };

🚀 Usage Basic Usage (Universal) This code snippet works seamlessly on both React Native and React Web.

import React from 'react'; import { View, Dimensions } from 'react-native'; import BannerComponent from 'react-native-dynamic-banner-carousel';

const App = () => { const banners = [ { id: 1, image: 'https://images.unsplash.com/photo-1555041469-a586c61ea9bc', name: 'Summer Sale', description: 'Up to 50% off on beachwear!' }, { id: 2, image: 'https://images.unsplash.com/photo-1506748686214-e9df14d4d9d0', name: 'New Arrivals', description: 'Check out the latest gadgets.' } ];

return ( <View style={{ flex: 1, paddingTop: 50 }}>

export default App;

⚙️ API Reference Props bannerData: Array — list of banner objects
autoplay: Boolean — enable/disable auto sliding
autoplayInterval: Number — interval in ms
showDots: Boolean — show/hide dot indicators
activeDotColor: String — color for active dot
dotColor: String — color for inactive dots
onBannerPress: Function — callback for banner click/tap
showContent: Boolean — enable content overlay text
styles: Object — override component styles

Data Structure Example [ { image: "https://example.com/img.jpg", name: "Banner Title", description: "Subtitle text", id: 1 } ]

🎨 Custom Styling Example

<BannerComponent bannerData={data} styles={{ wrapper: { marginBottom: 20 }, bannerContainer: { borderRadius: 20 }, dotsContainer: { bottom: 10 }, bannerTitle: { fontSize: 24, color: 'yellow' } }} />

Available Style Keys: wrapper, bannerContainer, imageContainer, contentOverlay, bannerTitle, bannerDescription, dotsContainer, dot

⚠️ Troubleshooting

  1. Native module not found (React Native)

Run: cd ios && pod install

  1. Images not showing on Web

Ensure parent container has height + valid image URLs.

  1. Layout broken on Web

Update to v1.1.4+ (uses inline styles instead of relying on Tailwind).

📄 License MIT