
Security News
CISA Kills Off RSS Feeds for KEVs and Cyber Alerts
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
vue3-perfect-scrollbar
Advanced tools
A minimalistic yet powerful Vue.js wrapper for [Perfect Scrollbar](https://perfectscrollbar.com/).
A minimalistic yet powerful Vue.js wrapper for Perfect Scrollbar.
Before implementing custom scrollbars, consider their potential impact on user experience. Native scrollbar styling, as supported by browsers like Chromeoor Firefox often provides a good balance of customization without sacrificing usability. Check out Chrome's documentation on scrollbar styling to see if it meets your needs. If your project requires precise design alignment that native options can't provide, then vue3-perfect-scrollbar is a solid choice.
npm
npm install vue3-perfect-scrollbar
yarn
yarn add vue3-perfect-scrollbar
pnpm
pnpm add vue3-perfect-scrollbar
Integrate vue3-perfect-scrollbar globally in your main application file:
import { createApp } from 'vue';
import { PerfectScrollbarPlugin } from 'vue3-perfect-scrollbar';
import 'vue3-perfect-scrollbar/style.css';
import App from './App.vue';
createApp(App).use(PerfectScrollbarPlugin).mount('#app');
Now, you can leverage the plugin in any component:
<PerfectScrollbar>
<p> Lorem Ipsum is simply dummy text of the printing and typesetting industry. </p>
<p> ... and much more content </p>
</PerfectScrollbar>
Customize the container height as needed:
/* example */
.ps {
height: 400px; /* or max-height: 400px; */
}
The install method accepts additional parameters:
app.use(PerfectScrollbarPlugin, {
componentName: 'Scrollbar'
});
componentName {String}
The name of your global component.
Default: PerfectScrollbar
For local registration, import and declare the component within your Vue component file:
<script setup>
import { PerfectScrollbar } from 'vue3-perfect-scrollbar'
</script>
<template>
<PerfectScrollbar>
<p>content</p>
</PerfectScrollbar>
</template>
<style>
@import 'vue3-perfect-scrollbar/style.css';
.ps {
max-height: 100px; /* or height: 100px; */
}
</style>
Customize the Perfect Scrollbar with the following props:
tag?: string;
options?: PerfectScrollbar.Options;
tag? {String}
The tag that will be rendered as the Perfect Scrollbar container.
Default: div
options? {PerfectScrollbar.Options}
: OptionsOptions for the Perfect Scrollbar library.
Explore Perfect Scrollbar options for further customization.
handlers?: string[];
maxScrollbarLength?: number;
minScrollbarLength?: number;
scrollingThreshold?: number;
scrollXMarginOffset?: number;
scrollYMarginOffset?: number;
suppressScrollX?: boolean;
suppressScrollY?: boolean;
swipeEasing?: boolean;
useBothWheelAxes?: boolean;
wheelPropagation?: boolean;
wheelSpeed?: number;
You can listen to all Perfect Scrollbar events.
Listen to all Perfect Scrollbar events. For a comprehensive list of events, visit Perfect Scrollbar events.
<script setup>
import { PerfectScrollbar } from 'vue3-perfect-scrollbar';
function onScrollEvent(event) {
console.log(event);
}
</script>
<template>
<PerfectScrollbar @ps-scroll-y="onScrollEvent">
<p>content</p>
</PerfectScrollbar>
</template>
'scroll',
'ps-scroll-y',
'ps-scroll-x',
'ps-scroll-up',
'ps-scroll-down',
'ps-scroll-left',
'ps-scroll-right',
'ps-y-reach-start',
'ps-y-reach-end',
'ps-x-reach-start',
'ps-x-reach-end'
To gain direct access to the Perfect Scrollbar instance and leverage its API within your Vue component, you can use the ref attribute.
Add to your nuxt.config.ts
:
export default defineNuxtConfig({
modules: ['vue3-perfect-scrollbar/nuxt']
});
Found a bug? Here's where to report it:
If it's about the vue3-perfect-scrollbar wrapper (like how it works with Vue, or issues with props and events), please report these bugs on our vue3-perfect-scrollbar GitHub repo.
If the bug is with the Perfect Scrollbar itself (like problems with how it scrolls or looks), you should report it to the official Perfect Scrollbar repo. Remember, vue3-perfect-scrollbar is just a wrapper to make Perfect Scrollbar work with Vue. It doesn't change how Perfect Scrollbar works. So, if there's something wrong with the scrollbar behavior, the Perfect Scrollbar team needs to know.
FAQs
A minimalistic yet powerful Vue.js wrapper for [Perfect Scrollbar](https://perfectscrollbar.com/).
The npm package vue3-perfect-scrollbar receives a total of 26,782 weekly downloads. As such, vue3-perfect-scrollbar popularity was classified as popular.
We found that vue3-perfect-scrollbar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.