Download react-slick/examples/VariableWidth.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 861 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-slick/examples/VariableWidth.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-slick/examples/VariableWidth.js
-
curl -L -o VariableWidth.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-slick/examples/VariableWidth.js
861 Bytes
| import React from "react"; | |
| import Slider from "react-slick"; | |
| function VariableWidth() { | |
| const settings = { | |
| className: "slider variable-width", | |
| dots: true, | |
| infinite: true, | |
| centerMode: true, | |
| slidesToShow: 1, | |
| slidesToScroll: 1, | |
| variableWidth: true | |
| }; | |
| return ( | |
| <div className="slider-container"> | |
| <Slider {...settings}> | |
| <div style={{ width: 100 }}> | |
| <p>100</p> | |
| </div> | |
| <div style={{ width: 200 }}> | |
| <p>200</p> | |
| </div> | |
| <div style={{ width: 75 }}> | |
| <p>75</p> | |
| </div> | |
| <div style={{ width: 300 }}> | |
| <p>300</p> | |
| </div> | |
| <div style={{ width: 225 }}> | |
| <p>225</p> | |
| </div> | |
| <div style={{ width: 175 }}> | |
| <p>175</p> | |
| </div> | |
| </Slider> | |
| </div> | |
| ); | |
| } | |
| export default VariableWidth; | |