react-scroll-shadow
Version:
Pure CSS shadow to indicate more content in scrollable area
67 lines (51 loc) • 1.18 kB
Markdown
> Pure CSS shadow to indicate more content in scrollable area
<div align="center">
<img src="demo.gif" alt="demo">
<br><br>
</div>
[](https://zzarcon.github.io/react-scroll-shadow)
```
$ yarn add react-scroll-shadow
```
**Basic**
```tsx
import ScrollShadow from 'react-scroll-shadow';
<ScrollShadow>
Content
</ScrollShadow>
```
**Custom**
```tsx
import ScrollShadow from 'react-scroll-shadow';
<ScrollShadow
bottomShadowColors={{
active: 'red',
inactive: 'white'
}}
topShadowColors={{
active: 'blue',
inactive: 'white'
}}
shadowSize={2}
>
Content
</ScrollShadow>
```
```ts
interface ShadowColors {
inactive: string;
active: string;
}
interface Props {
height?: string;
bottomShadowColors?: ShadowColors;
topShadowColors?: ShadowColors;
shadowSize?: number;
}
```
See [example/](https://github.com/zzarcon/react-scroll-shadow/tree/master/example) for full example.