Socket
Book a DemoInstallSign in
Socket

@vuetility/vue-custom-scroller

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vuetility/vue-custom-scroller

A customizable Vue scroller component 📜 📦

0.0.6
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Custom Scroller

A customizable Vue scroller component 📜📦

WARNING: custom-scroller is at pre-alpha stage of development and may undergo significant changes.

Feel free to submit issues and feature requests here.

Table of Contents

Installation

npm i @vuetility/vue-custom-scroller

or if you prefer yarn

yarn add @vuetility/vue-custom-scroller

Usage

Global

You may install Custom Scroller globally:

import Vue from 'vue';
import VueCustomScroller from '@vuetility/vue-custom-scroller';

Vue.use(VueCustomScroller);

This will make <custom-scroller> available to all components within your Vue app.

Local

Include the custom scroller directly into your component using import:

<script>
import { CustomScroller } from '@vuetility/vue-custom-scroller';

export default {
  ...
  components: {
    CustomScroller
  }
  ...
};
</script>
<template>
  ...
    <scrollable-element ref="targetEl"></scrollable-element> /* some scrollable element(component) */
    <custom-scroller targetElement="targetEl"/>
  ...
</template>

Props

PropertyTypeRequiredDefaultDescription
targetElementStringtrueref of the element to scroll, it can be an HTMLElement or a VueComponent
onlyShowIfOverflowingBooleanfalsetrueOnly show scroller if the target element overflows
customClassStringfalseclass name to override the scroller styles(find the default styles attached below)

Default styles

.v-vuetility__vue-custom-scroller {
    width: 200px;
    outline: none;
    -webkit-appearance: none;
    background: #EBEBEB;
    border-radius: 4px;
    cursor: pointer;
}
.v-vuetility__vue-custom-scroller::-webkit-slider-thumb {
    -webkit-appearance: none;
    border: 1px solid #233242;
    height: 5px;
    width: var(--slider-thumb-width);
    cursor: pointer;
    background: #233242;
    border-radius: 4px;
    box-shadow: 1px 1px 1px #233242, 0 0 1px #233242;
}

Default styles can be overridden by passing the custom class name as a prop, like this:

<template>
    ...
    <custom-scroller 
        targetElement="targetEl" 
        customClass="custom-class"
        onlyShowIfOverflowing
        step="0.7"
    ></custom-scroller>
    ...
</template>
<style lang="scss">
.custom-class {
    /*...styles here...*/
}
.custom-class::-webkit-slider-thumb {
    /*...styles here...*/
}
</style>

Demo

Click here to see the component in action.

Development

To begin development, run:

npm install
npm run serve

then navigate to http://localhost:8080/

Keywords

custom-scroller

FAQs

Package last updated on 17 May 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.