npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@alinsme/simplebar-vue3

v0.2.3

Published

!!! Please use native [simplebar-vue](https://www.npmjs.com/package/simplebar-vue) library. This library is not maintained anymore.

Readme

!!! Please use native simplebar-vue library. This library is not maintained anymore.

simplebar-vue3

A Vue3 Wrapper for SimpleBar

Intallation

For npm and pnpm:

(npm or pnpm) install simplebar simplebar-vue3

For yarn:

yarn add simplebar simplebar-vue3

Usage

You need to import simplebar stylesheet in your main.(js|ts) file for scrollbar to look normal and work.

main.(js|ts)
import 'simplebar/dist/simplebar.min.css';

import { createApp } from 'vue';
import App from './App.vue';
createApp(App).mount('#app');

To use it in .vue files just import the component and use.

<template>
   <SimpleBar style="height: 500px; overflow-y: auto"> ... Content Goes here </SimpleBar>
</template>

<script setup>
   import { SimpleBar } from 'simplebar-vue3';
</script>
<!-- FOR NORMAL SCRIPT -->
<script>
   import { SimpleBar } from 'simplebar-vue3';
   import { defineComponent } from 'vue';

   export default defineComponent({
      components: { SimpleBar }
   });
</script>

Accessing Simplebar Instance

Via event;

If you want to access simplebar instance by event you can use @created event.

<template>
   <SimpleBar
      @created="instance => {
         simplebarInstance = instance;
      }"
   >
   </SimpleBar>
</template>

<!-- Typescript is optional -->
<script setup lang="ts">
   import type { SimplebarInstanceRef } from 'simplebar-vue3';
   import { SimpleBar } from 'simplebar-vue3';
   import { ref } from 'vue';

   const simplebarInstance = ref<SimplebarInstanceRef>(null);
</script>
Via template ref;

You access simplebar instance ref

<template>
   <SimpleBar ref="simplebarInstance"> </SimpleBar>
   <!-- Or this behavior can be used but it will give type error probably -->
   <SimpleBar :ref="(instance) => { simplebarInstance = instance }"> </SimpleBar>
</template>

<!-- Typescript is optional -->
<script setup lang="ts">
   import type { SimplebarInstanceRef } from 'simplebar-vue3';
   import { SimpleBar } from 'simplebar-vue3';
   import { ref } from 'vue';

   const simplebarInstance = ref<SimplebarInstanceRef>(null);
</script>
Via composable;

In CHILD COMPONENTS you can use useSimplebar composable to access simplebar instance as a Ref. NOTE: If you try access to instance before parent mounted this composable will return null;

parent.vue
<SimpleBar>
   <ChildComponent />
</SimpleBar>
child.vue
<!-- Typescript is optional -->
<script lang="ts">
   import { useSimplebar } from 'simplebar-vue3';
   import { onMounted } from 'vue';

   const simplebar = useSimplebar();
   onMounted(() => {
      simplebar.value.recalculate();
      simplebar.value.el.getBoundingClientRect();
      // or more
   });
</script>

Props

import { Options } from 'simplebar';

interface SimpleBarProps {
   /**
    * @default {'div'}
    */
   tag?: string;
   options?: Options;
}

TypeScript Support

This package has built-in typescript support for events and props it should work with .tsx files with no trouble.

To have types support in vue files we recommend you to use Volar plugin. Volar TypeScript Vue Plugin