@koas/v-hscroll

Vue directive thay enables mouse wheel horizontal scrolling on any element
6,804 8
Install
npm install @koas/v-hscroll
Latest Version:1.0.3
License:MIT
Last Updated:Feb 22, 2022
Links: GitHub  ·  npm
Maintainer: koas

v-hscroll

Vue directive for mouse wheel horizontal scrolling.

Documentation and examples available at the demo page.

Quick start

Install via npm:

$ npm install @koas/v-hscroll

Import in your main.js file:

import HScroll from "@koas/v-hscroll";

Add the directive to any element with an horizontal scroll:

<template>
	<div class="outer">
		<div v-hscroll class="inner">
			<div class="element">1</div>
			<div class="element">2</div>
			<div class="element">3</div>
			<div class="element">4</div>
		</div>
	</div>
</template>

<style type="text/css">
.outer {
	width: 650px;
}
.inner {
	overflow: auto;
	white-space: nowrap;
	border: 1px solid #000;
}
.element {
	width: 250px;
	height: 150px;
	background: #000;
	color: #fff;
	margin: 10px;
	display: inline-flex;
	justify-content: center;
	align-items: center;
}
</style>


Related Packages

vue-scroll

scroll directive for vuejs 2.0

345,040 242
@centaurea/vue3-scroll

vue 3 version of vue-scroll

2,682 1
v-scroll-threshold

A vue directive that accepts a threshold value and a callback function that tell...

31,165 1
vue3-chat-scroll

Vue directive to keep things scrolled to the bottom

20,446 1
vue-prevent-parent-scroll

A Vue directive that prevents vertical scrolling outside the current element whe...

15,247 20

Version History

Version Released License
1.0.3 MIT
1.0.2 MIT
1.0.1 MIT
1.0.0 MIT