Skip to content

rafalolszewski94/vue3-smooth-scrollbar

Repository files navigation

vue3-smooth-scrollbar

Test build

Based on vue-smooth-scrollbar

Requirements

  • Vue 3

Installation

NPM

npm install vue3-smooth-scrollbar  #  yarn add vue3-smooth-scrollbar

Usage

Custom main scrollbar

App.vue

<template>
  <scrollbar>
    <!-- content -->
  </scrollbar>
</template>

<script>
import Scrollbar from "vue3-smooth-scrollbar";

export default {
  components: { Navbar, Scrollbar },
};
</script>

Add to your styles

body {
  overflow: hidden;
}

// Assuming you're using default mount element
#app {
  height: 100vh;
  overflow: auto;
}

Development

Project setup

npm run install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Lints and fixes files

npm run lint