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-glide

v4.1.0

Published

A multi purpose carousel module built in React.

Downloads

137

Readme

react-glide

A lightweight, multi-purpose carousel component for React.

npm version CircleCI

demo

Installation

$ npm install react-glide

Usage

Import the module at the top of your component page:

import { Glide } from 'react-glide';
import 'react-glide/lib/reactGlide.css'

Glide functions as a wrapper and can be passed any type of element. See example folder:

<Glide height={500} width={500}>
  <img src='http:/path/to/image/url' />
  <img src='http:/path/to/image/url2' />
  <img src='http:/path/to/image1/url3' />
</Glide>

Options

Types

interface GlideProps {
  autoPlay?: boolean;
  autoPlaySpeed?: number;
  dots?: boolean;
  height?: number;
  infinite?: boolean;
  width: number;
  onSlideChange?: () => void;
}

Props Description

| option | type | description | default | required | |------------ |-----------|---------------------------------------|---------|-----------| |width |integer | the width of the carousel container. | none | Yes | |height |integer | the height of the carousel container. | none | No | |autoPlay |bool | enables or disables autoPlay feature.| false | No | |autoPlaySpeed |integer | the rate of change between slides, defined in ms.| 2000 | No | |infinite |bool | carousel will loop infinitely | true | No | |dots |bool | dot navigation & pagination | true | No | |onSlideChange |func | a function that will fire when the slide changes | none | No |

Styles

Default Styles

To use the default styles, import the CSS from react-glide at the top of your file:

import 'react-glide/lib/reactGlide.css';

Overriding Default Styles

in order to fit the design of your project, you can override the default styles by using the class names below in your projects own stylesheet:

| element | class name | |------------ |-----------| | containers | .glide--container | | | .glide--item| | | .glide--item.current | | buttons | .glide--next-btn | | | .glide--prev-btn| | dots | .glide--dots | | | .glide--dots-active | | | .glide--dots-inactive |

Development

Install dependencies:

$ npm install

Run storybook at http://localhost:6006:

$ npm start

Run ssr test app at http://localhost:3000:

$ cd ./ssr-testing && npm i && npm start

Run tests in watch mode:

$ npm run test

Execute a single run of tests:

$ npm run test:once

Run linter check:

$ npm run lint:check

Run linter auto fix:

npm run lint:fix

License

MIT