![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
react-smart-scroller
Advanced tools
React-smart-scroller is a library that allows you to create highly customizable horizontal or vertical scroller in easy way. You can modify track styles or pass your own thumb (own component)
React-smart-scroller is a library that allows you to create highly customizable horizontal or vertical scroller in easy way.
You can modify scrollbar track just like you want, adding some styles to it, and change look of scrollbar thumb just simply passing styled JSX Element.
Define your own spacing or columns per scroller width simply passing props.
yarn add react-smart-scroller
or npm install --save react-smart-scroller
Property | Type | Description |
---|---|---|
numCols | number | Default: undefined .Number of columns per container width. If 1, width of each child is 100%. If not provided, column has childs width. |
spacing | number | Default: 0 .Space in pixels between elements. |
trackProps | React.CssProperties | Default: undefined .CSS styles to original track. |
thumb | JSX.Element | Default: rectangle .Element that if provided overrides default rectangle. |
vertical | boolean | Default: false .Defines direction of scrollbar - horizontal by default. If height of ReactSmartScroller is not defined it will automatically resize to 100% and scroll will not be visible. |
draggable | boolean | Default: false .Allows to scroll by dragging content. |
Let's create our first component
import React from 'react'
import { ReactSmartScroller } from 'react-smart-scroller'
const renderImages = () => {
const images = [
'https://cdn.pixabay.com/photo/2019/06/02/00/46/chapel-4245437__340.jpg',
'https://cdn.pixabay.com/photo/2017/08/22/22/36/cinque-terre-2670762__340.jpg',
'https://cdn.pixabay.com/photo/2016/08/01/20/34/girl-1562091__340.jpg',
'https://cdn.pixabay.com/photo/2013/09/26/23/23/glitter-powder-186829__340.jpg',
'https://cdn.pixabay.com/photo/2019/04/11/09/50/wave-4119274__340.jpg'
]
return images.map((image, index) => (
<img
key={index}
src={image}
style={{
width: '100%',
height: 300,
objectFit: 'cover'
}}
/>
))
}
export const Slider = () => (
<ReactSmartScroller>
{renderImages()}
</ReactSmartScroller>
)
This is what you'll see in your browser:
export const Slider = () => (
<ReactSmartScroller numCols={3}>
{renderImages()}
</ReactSmartScroller>
)
export const Slider = () => (
<ReactSmartScroller spacing={24}>
{renderImages()}
</ReactSmartScroller>
)
export const Slider = () => (
<ReactSmartScroller
trackProps={{
height: 25
}}
>
{renderImages()}
</ReactSmartScroller>
)
export const Slider = () => (
<ReactSmartScroller
thumb={
<div
style={{
width: 20,
height: 20,
borderRadius: '50%',
backgroundColor: 'black'
}}
/>
}
>
{renderImages()}
</ReactSmartScroller>
)
export const Slider = () => (
<div
style={{
width: 500,
height: 600
}}
>
<ReactSmartScroller vertical>
{renderImages()}
</ReactSmartScroller>
</div>
)
export const Slider = () => (
<ReactSmartScroller draggable>
{renderImages()}
</ReactSmartScroller>
)
FAQs
React-smart-scroller is a library that allows you to create highly customizable horizontal or vertical scroller in easy way. You can modify track styles or pass your own thumb (own component)
The npm package react-smart-scroller receives a total of 163 weekly downloads. As such, react-smart-scroller popularity was classified as not popular.
We found that react-smart-scroller demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.