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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-responsive-3d-carousel

v1.4.3

Published

React Responsive 3D Carousel

Downloads

615

Readme

License: MIT

The React Responsive 3D Carousel is a versatile component designed for React applications. It offers a responsive user interface that adapts seamlessly to different screen widths. Notably, it also includes support for recognizing swipe gestures on mobile devices.

Getting started with this package is straightforward. Explore the documentation for installation and usage instructions.

Demo Page & Links

Key Features

  • Source map-excluded JavaScript file size is 12KB.
  • Experience a responsive design that adapts to various screen sizes.
  • Enable swipe gesture recognition to enhance mobile usability.
  • Supports TypeScript and CommonJS.

Installation

Install the package with the following command. React18 should be pre-installed.

npm install react-responsive-3d-carousel

Usage

You can pass down any <tag/> you want

import React from 'react'
import { Carousel } from 'react-responsive-3d-carousel'

export default App() {
  return (
    <Carousel>
      <img src="https://example-image-url-1" alt="example-image-1" />
      <img src="https://example-image-url-2" alt="example-image-2" />
      <video src="https://example-video-url" muted autoPlay loop />
      <iframe src="https://www.youtube.com/embed/example" title="YouTube video player" frameborder="0"/>
      <div>
        <p>Hello</p>
      </div>
    </Carousel>
  )
}

If the tag you want to display on the screen does not go down directly, you must add the following styling.

import React from 'react'
import { Carousel } from 'react-responsive-3d-carousel'

export default App() {
  return (
    <Carousel>
      <a href="https://unsplash.com/">
        <img
          src="https://source.unsplash.com/random/?dog"
          alt="sample-image"
          style={{
            width: '100%',
            height: '100%',
            objectFit: 'cover',
          }}
        />
      </a>
    </Carousel>
  )
}

Props

| Name | Type | Default | Description | | ----------------------- | -------------------------- | ------------------------ | ------------------------------------------------------ | | width | string | '500px' | Width of each carousel item (Accepts all CSS units) | | height | string | '300px' | Height of each carousel item (Accepts all CSS units) | | spread | 'wide', 'normal', 'narrow' | 'wide' | Adjusts the horizontal spacing between carousel items. | | depth | number | 1 | 3D depth of the carousel | | autoPlay | boolean | true | Automatically play slide animation | | interval | number | 3000 | Slide transition time interval (ms) | | transitionTime | number | 500 | Slide transition animation time (ms) | | infiniteLoop | boolean | true | Enable slide animation infinitely | | startIndex | number | 0 | Index of the first carousel item to be centered | | pauseOnHover | boolean | true | Stop slide animation when user hovers over carousel | | selectable | boolean | true | Clicking a carousel item positions it to the center | | onClickCenteredItem | (index: number) => void | undefined | Event fired when centered item is clicked | | isShadow | boolean | true | Display shadows of carousel items | | showStatus | boolean | true | Display top right status text (e.g., 2/5) | | statusSize | 'small', 'medium', 'large' | 'small' | Size of the status text | | statusColor | string | 'rgb(255, 255, 255)' | Color of the status text | | isStatusShadow | boolean | true | Display shadows for the status text | | showArrows | boolean | true | Display arrow buttons at both ends | | arrowsWidth | string | '48px' | Width of each arrow (Accepts all CSS units) | | arrowsHeight | string | '83px' | Height of each arrow (Accepts all CSS units) | | arrowsDefaultColor | string | 'rgb(255, 255, 255)' | Color of arrows when not hovered | | arrowsHoveredColor | string | 'rgba(34, 34, 34, 0.53)' | Color of arrows when hovered | | arrowsStrokeWidth | number | 5 | The stroke width of arrows path | | isArrowsShadow | boolean | true | Display shadows for arrows | | showIndicators | boolean | true | Display bottom indicators | | indicatorsSize | 'small', 'medium', 'large' | 'small' | Size of the indicators | | indicatorsActiveColor | string | 'rgb(255, 255, 255)' | Color of an activated indicator | | indicatorsInactiveColor | string | 'rgba(67, 67, 67, 0.4)' | Color of inactivated indicators | | isIndicatorsShadow | boolean | true | Display shadows for the indicators |

Customizing

If necessary, you can override the CSS with !important. The class name can be found in the browser's developer tools or source code.

.react-responsive-3d-carousel__indicators li {
  width: 36px !important;
  height: 36px !important;
}

Contributing

Since this is my first npm package. Welcome to conributing.
Here's contributing guide that contains details on how to set up a development environment.

Issues

If you encounter an issue, please don't hesitate to let me know. Provide a detailed explanation along with any relevant images, and I'll do my best to make improvements. Github Issues