New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tiny-slider-react

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiny-slider-react

wrapper tiny-slider plugin for react

latest
Source
npmnpm
Version
0.5.7
Version published
Maintainers
1
Created
Source

tiny-slider-react

Original plugin tiny-slider

Tiny Slider v2 <=> tiny-slider-react >= v5

Tiny Slider v1 <=> tiny-slider-react <= v4

demo demo2

props

propdecription
settingsoptions slider
onClickcallback to return slide clicked (slideClicked, info, event)
startIndexindex of carousel initiation
onIndexChangedevent bind
onTransitionStartevent bind
onTransitionEndevent bind
onTouchStartevent bind
onTouchMoveevent bind
onTouchEndevent bind
import TinySlider from "tiny-slider-react";
import 'tiny-slider/dist/tiny-slider.css';

const settings = {
  lazyload: true,
  nav: false,
  mouseDrag: true
};

<TinySlider settings={settings}>
    {imgs.map((el, index) => (
      <div key={index} style={{ position: "relative" }}>
        <img
          className={`tns-lazy-img`}
          src={loadingImage}
          data-src={el}
          alt=""
          style={imgStyles}
        />
      </div>
    ))}
</TinySlider>

How to use external buttons for prev & next

const settings = {
  lazyload: true,
  nav: false,
  mouseDrag: true,
  controls: false // remove built-in nav buttons
}

Get the slider from refs:

<TinySlider settings={settings} ref={ts => this.ts = ts}>...</TinySlider>

Add onClick for your buttons:

<button type="button" onClick={() => this.onGoTo('prev')}>Previous</button>
<button type="button" onClick={() =>  this.onGoTo('next')}>Next</button>

Add the handler on your component:

onGoTo = dir => this.ts.slider.goTo(dir)

Keywords

tiny-slider

FAQs

Package last updated on 22 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts