![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
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. |
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>
)
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)
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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.