vue3-scroll-shadow
Vue 3 Scroll Shadow
Add UX-friendly shadow to your scrollable list
Installation
npm i vue3-scroll-shadow
Usage
import VueScrollShadow from 'vue3-scroll-shadow'
<template>
<vue-scroll-shadow>
<!-- Your content goes here -->
</vue-scroll-shadow>
</template>
Props
Name | Type | Default | Description |
---|---|---|---|
height | String | '100%' | Height of container |
throttleWait | Number | 100 | Handle scroll event at most once per throttleWait milliseconds |
shadowColorFrom | String | '#00000014' | Start color of scroll shadow. Can be RGB or RGBA: - #000 - #000000 - #0004 - #00000044 |
shadowColorTo | String | 'transparent' | End color of scroll shadow. Same as above |
shadowSize | String | '15px' | Size of shadow |
Slot Attributes
Name | Value | Description |
---|---|---|
scrollState | { isOffTop: Boolean , isOffBottom: Boolean } |
When the list is scrollable, isOffTop is true when not at the top, isOffBottom is true when not at the bottom |
Example
<vue-scroll-shadow v-slot="{ scrollState }">
// you can use scrollState.isOffTop or scrollState.isOffBottom here
</vue-scroll-shadow>
Dependencies
@babel/core: ^7.12.10@babel/preset-env: ^7.12.11@babel/preset-typescript: ^7.12.7@rollup/plugin-alias: ^3.1.1@rollup/plugin-babel: ^5.2.2@rollup/plugin-commonjs: ^17.0.0@rollup/plugin-node-resolve: ^11.0.1@rollup/plugin-replace: ^2.3.4@vue/cli-plugin-babel: ^4.5.10@vue/cli-plugin-typescript: ^4.5.10@vue/cli-service: ^4.5.10@vue/compiler-sfc: ^3.0.5cross-env: ^7.0.3minimist: ^1.2.5postcss: ^8.2.3rollup: ^2.36.1rollup-plugin-postcss: ^4.0.0rollup-plugin-terser: ^7.0.2rollup-plugin-vue: ^6.0.0typescript: ^3.8.3vue: ^3.0.5@types/lodash: ^4.14.168lodash: ^4.17.21