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

staw

v0.3.0

Published

One Carousel to rule them all. Simple like recompose, weightless like a leaf and very easy to Staw (badum tsss)

Downloads

335

Readme

Staw

One Carousel to rule them all. Simple like recompose, weightless like a leaf and very easy to Staw (badum tsss)

Installing

In your project folder, type on console

yarn add staw

or you can use NPM aswell

npm i staw

Usage

Import the component from Node Modules

import Staw from 'staw';

Input all slides section as children

<Staw>
	child1
	child2
	child3
</Staw>

Each child will be a slide

Props

Name | Description | Default Value --------- | -------- | ---------------- visibleGutter| amount of next slide that should appear in px, if the slide isn't the first one or the last one, this amount is halfed in the next and previous slide. | 0 startAt| number (array index based) that defines the initial slide that's considered 'active' | 0 hasDots| boolean that define if have or not dots for navigation. | true hasArrows | boolean that define if have or not arrow for navigation. | true customArrow | Add a custom arrow markup | null customNavigation | An array of strings. Each string will behave as a Dot behaves | false alignAll| boolean that aligns the first and the last child in the center | false slidesPerView | value that will define the quantity slides to show, your can use number or 'auto' | 1 onDotClick(cardIndex) | a callback that executes on dot click | (cardIndex) => {} onPrevArrowClick(currentSlide) | a callback that executes on prev arrow click, before currentSlide update | (currentSlide) => {} onNextArrowClick(currentSlide) | a callback that executes on next arrow click, before currentSlide update | (currentSlide) => {} onSwipeLeftToRight(currentSlide) | same as prevArrowClick but for swipe | (currentSlide) => {} onSwipeRightToLeft(currentSlide) | same as nextArrowClick but for swipe | (currentSlide) => {}

Example

<Staw
    visibleGutter={30}
    startAt={0}
    hasDots={false}
    customNavigation={['First','Second','Third']}
    onPrevArrowClick={(currentSlide) => {
        console.log(currentSlide)
    }}
>
    <div className="firstSlide">
        <div className="anyClass">content of my first slide</div>
    </div>
    <div className="secondSlide">
        <div className="anyClass">content of my second slide</div>
    </div>
    <div className"thirdSlide">
        <div className="anyClass">a lot of items</div>
        <div className="anyClass">in the same</div>
        <div className="anyClass">slide depends only of yours css</div>
    </div>
</Staw>

Dependencies

  • React ^16.0.0
  • ReactDOM ^16.0.0
  • Recompose ^0.26.0

License

Licensed under the MIT license.