@slick-slider/slick
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

React Slick Slider

type SlickProps<T> = {
  images: T[];
  onClick?: (image: T) => void;
  urlExtractor: (image: T) => string;
  keyExtractor?: (image: T) => string;
  styleImg?: CSSProperties;
  aspectRatio?: string;
  durationAnimation?: number;
  durationAutoPlay?: number;
  dotStyle?: CSSProperties;
  loop?: boolean;
};

Example

import { Slick } from "@slick-slider/slick";
import { useState } from "react";

const images = [
  {
    url: 'url1',
  },
  {
    url: 'url2',
  },
];

function App() {
  return (
    <div style={{ width: "100%", height: "100%", margin: "auto" }}>
      <Slick
        keyExtractor={(image) => image.url}
        urlExtractor={(image) => image.url}
        onClick={(image) => {
          console.log('image', image)
        }}
        images={images}
        aspectRatio="375 / 196"
        durationAnimation={500}
        durationAutoPlay={4000}
      />
    </div>
  );
}

export default App;

Package Sidebar

Install

npm i @slick-slider/slick

Weekly Downloads

0

Version

1.0.3

License

UNLICENSED

Unpacked Size

18.4 kB

Total Files

5

Last publish

Collaborators

  • levinhsang