Download react-slick/examples/CustomArrows.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.19 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-slick/examples/CustomArrows.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-slick/examples/CustomArrows.js
-
curl -L -o CustomArrows.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-slick/examples/CustomArrows.js
1.19 kB
| import React, { Component } from "react"; | |
| import Slider from "react-slick"; | |
| function SampleNextArrow(props) { | |
| const { className, style, onClick } = props; | |
| return ( | |
| <div | |
| className={className} | |
| style={{ ...style, display: "block", background: "red" }} | |
| onClick={onClick} | |
| /> | |
| ); | |
| } | |
| function SamplePrevArrow(props) { | |
| const { className, style, onClick } = props; | |
| return ( | |
| <div | |
| className={className} | |
| style={{ ...style, display: "block", background: "green" }} | |
| onClick={onClick} | |
| /> | |
| ); | |
| } | |
| function CustomArrows() { | |
| const settings = { | |
| dots: true, | |
| infinite: true, | |
| slidesToShow: 3, | |
| slidesToScroll: 1, | |
| nextArrow: <SampleNextArrow />, | |
| prevArrow: <SamplePrevArrow /> | |
| }; | |
| return ( | |
| <div className="slider-container"> | |
| <Slider {...settings}> | |
| <div> | |
| <h3>1</h3> | |
| </div> | |
| <div> | |
| <h3>2</h3> | |
| </div> | |
| <div> | |
| <h3>3</h3> | |
| </div> | |
| <div> | |
| <h3>4</h3> | |
| </div> | |
| <div> | |
| <h3>5</h3> | |
| </div> | |
| <div> | |
| <h3>6</h3> | |
| </div> | |
| </Slider> | |
| </div> | |
| ); | |
| } | |
| export default CustomArrows; | |