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

@jdthornton/carousel

v1.1.1

Published

React carousel context and components

Downloads

51

Readme

@jdthornton/carousel

npm (scoped) npm bundle size (minified)

React carousel context and components.

Demo

https://jdthornton.github.io/#/carousel

Install

$ npm install @jdthornton/carousel

Usage

import Carousel from "@jdthornton/carousel";
import '@jdthornton/carousel/styles.css';

function App(){
  return(
    <Carousel
      visibleCount={2}
      step={2}
      scrollbarHide>
      <div>Slide 1</div>
      <div>Slide 2</div>
      <div>Slide 3</div>
      <div>Slide 4</div>
      <div>Slide 5</div>
    </Carousel>
  )
}

Props

| Prop | Type | Description | | :------------------------------------------------------------------------ | :---------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | visibleCount | number | The number of slides visible | | step | number | The number of slides between each step | | infinite | boolean | Enables the Carousel to start over when out of steps | | scrollable | boolean | Enables scrolling | | autoPlay | boolean | Enables the Carousel to automatically take steps based on the interval prop. | | interval | number (in milliseconds) | The time in milliseconds it takes Carousel to automatically take a step. | | disableControls | boolean | Disables all controls | | disableKeyboard | boolean | Disables keyboard controls | | overlayControls | boolean | Enables control UI overlay | | autoFocus | boolean | The Carousel will be focused on mount | | showOnFocus | boolean | Shows control UI when Carousel is focused | | controlOnFocus | boolean | Allows controls when Carousel is focused | | stopOnFocus | boolean | Pauses autoplay when Carousel is focused | | dark | boolean | Switches to dark mode | | isVertical | boolean | Switches Carousel to vertical axis | | dotsOverlay | boolean | Enables dots UI overlay | | dotsIsVertical | boolean | Switches dots UI to vertical axis | | dotsDark | boolean | Switches dots UI to dark mode | | dotsShowOnFocus | boolean | Only show dots UI when Carousel is focused | | dotsHide | boolean | Hides dots UI | | arrowsOverlay | boolean | Enables arrows UI overlay | | arrowsIsVertical | boolean | Switches arrows UI to vertical axis | | arrowsDark | boolean | Switches arrows UI to dark mode | | arrowsShowOnFocus | boolean | Only show arrows UI when Carousel is focused | | arrowsHide | boolean | Hides arrows UI | | scrollbarOverlay | boolean | Enables scrollbar UI overlay | | scrollbarIsVertical | boolean | Switches scrollbar UI to vertical axis | | scrollbarDark | boolean | Switches scrollbar UI to dark mode | | scrollbarShowOnFocus | boolean | Only show scrollbar UI when Carousel is focused | | scrollbarHide | boolean | Hides scrollbar UI | | sliderIsVertical | boolean | Switches slider and slides to vertical axis | | className | string | Custom class to be added to Carousel wrapper element | | classNames | { container, slider, nextArrow, prevArrow, dot, activeDot } | Custom classes to be used with the Carousel. Classes passed via the classNames prop are added to the defaults | | style | object | Custom style to be added to the Carousel wrapper element | | styles | { container, slider, nextArrow, prevArrow, dot, activeDot } | Custom styles to be used with the Carousel. Styles passed via the styles prop are added to the defaults | | renderNextArrow | ({ onClick: () => void, hasNext: boolean }) => React.ReactNode | Render custom next button. Receives an onClick function, which moves the slider forward one step, and a hasNext boolean which is true if there is another step available. | | renderPrevArrow | ({ onClick: () => void, hasPrev: boolean }) => React.ReactNode | Render custom previous button. Receives an onClick function, which moves the slider backwards one step, and a hasPrev boolean which is true if there is another step available. | | renderDot | ({ onClick: () => void, step: number, isActive: boolean }) => React.ReactNode | Render custom dot. Receives an onClick function, which moves the slider to the step the dot indicates, a step number, representing the step index of the dot, and an isActive boolean, if the dot's step index matches the Carousel's active step index. |