A scrollable container with a custom scrollbar that looks great on every device.
You should have the chayns-components
package installed. If that is not the
case already, run
yarn add chayns-components
or
npm i chayns-components
After the chayns-components
package is installed, you can import the component
and use it with React:
import React from 'react'
import { ScrollView } from 'chayns-components';
// ...
<ScrollView {...} />
The ScrollView
-component takes the following props:
Name | Type | Default | Required |
---|---|---|---|
children | ReactNode | Array<ReactNode> |
||
style | { [key: string]: number | string } |
||
className | string |
||
scrollElementId | string |
||
scrollElementRef | function |
||
onScroll | function |
children?: ReactNode | Array<ReactNode>
The contents of the ScrollView
.
style?: { [key: string]: number | string }
A React style object that will be applied to the outer-most container. Specify a
height
or maxHeight
here.
className?: string
A classname string that will be applied to the outer-most container.
scrollElementId?: string
A HTML id that will be applied to the scroll container.
scrollElementRef?: function
A function that receives the reference to the scroll container element as its first argument.
onScroll?: function
The onScroll
-listener for the scroll container.