A Modern, Responsive Pure Vue Horizontal Layout Library

Vue Horizontal is to design your web application for a horizontal experience which can be boring and cumbersome if you are new to web development. Whereas vertical design comes naturally whereas HTML is naturally vertical by the view of the design: block. With Display: flex, aligning content horizontally becomes natural and intuitive but does not support flow or navigation. You start adding more hacks and tricks to get the layout you want, but these hacks aren’t consistent and have been SSG or cross-browser SEO tested. You found the idea.

There are many libraries already in the open-source world, some using DOM manipulation directly, others importing JavaScript or another old JQuery library. You do not want that. Vue already does that. This is the original Vue built for Vue, and Vue is the only peer dependency required. All display modes (SPA / SSR / SSG) are supported and tested with E2E tools.

horizontal scroll example, horizontal scrolling website, horizontal scrolling div with arrows, horizontal scroll website template, horizontal scrolling website html

Features

  • SSR / SSG / SPA: Support all rendering modes
  • Mobile-first for responsive web
  • Customizable navigation: slider, buttons, or basically everything
  • Focus on UX, smooth scrolling, capture for a variety of use cases.
  • Small size 3KB for CDN users
  • Highly expandable for any use case with well-documented recipes.
  • You can control how your content is organized with HTML
  • You can control its appearance using CSS
  • You can control how the layout is navigated with Vue.js

How to make use of it:

Install and download:

# Yarn
$ yarn add vue-horizontal

# NPM
$ npm i vue-horizontal

1. Import and register the component.

import VueHorizontal from 'vue-horizontal';
export default {
  components: {VueHorizontal}
}
// or
Vue.use(VueHorizontal);

2. Add the <vue-horizontal> component to the template.

<vue-horizontal>
</vue-horizontal>

3. Add slidesĀ to the scroller.

<vue-horizontal>
  <div class="item">
    <h3>Item 1</h3>
    <p>As you can see these are just html elements.</p>
  </div>
  <section>
    <h4>Item 2</h4>
  </section>
  <section>
    <h3>Item 3</h3>
  </section>
  <section v-for="item in items" :key="item.i">
    <h3>{{ item.title }}</h3>
    <p>{{ item.content }}</p>
  </section>
  <section>
    <h3>Last Item</h3>
  </section>
</vue-horizontal>
export default {
  data() {
    return {
      items: [...Array(5).keys()].map((i) => {
        return {i, title: `v-for: ${i}`, content: `šŸš€ Paragraph ${i}`};
      }),
    }
  }
}

4. Component props available.

button: {
  type: Boolean,
  default: () => true,
},
buttonBetween: {
  type: Boolean,
  default: () => true
},
scroll: {
  type: Boolean,
  default: () => false,
},
responsive: {
  type: Boolean,
  default: () => false,
},
/**
 * Move window, indicates the percent of width to travel when nav is triggered.
 */
displacement: {
  type: Number,
  default: () => 1.0
},
/**
 * Snap to start|center|end
 */
snap: {
  type: String,
  default: () => 'start',
},

5. API methods.

// prev item
$refs.horizontal.prev();
// next item
$refs.horizontal.next();
// scroll to an item
$refs.horizontal.scrollToIndex(index);
// scroll to left
$refs.horizontal.scrollToLeft(index);
// refresh the scroller
$refs.horizontal.refresh();

6. Events.

onPrev() {
  this.prev += '- clicked prev'
},
onNext() {
  this.next += '- clicked next'
}
nScroll(data) {
  this.scroll = data
},
onScrollDebounce(data) {
  this.scrollDebounce = data
}

Horizontal Scroller Layout For Vue, Vue Horizontal Plugin/Github, horizontal scroll test, website horizontal scroll problem


See Demo And Download

Official Website(fuxingloh): Click Here

This superior jQuery/javascript plugin is developed by fuxingloh. For extra Advanced Usages, please go to the official website.

Related Posts

Iconpicker-Bootstrap-5

[Icon Picker] Iconpicker for Bootstrap 5 Icons Library

Bootstrap 5-basedĀ icon picker which supports any icon libraries like Bootstrap Icons, Font Awesome[fontawesome.com], etc. Must Read: 1000+ Pixel Perfect SVG Icons For Vue Components | Unicons How…

bootstrap-multiple-image-upload-with-preview

Bootstrap Multiple Image Upload with Preview and Delete | ImagesLoader

ImagesLoader is a standard bootstrap image upload plugin that provides an easy-to-use and nice-looking interface for uploading multiple images to a web server. Must Read: HTML 5…

Animating-Split-Flap-Displays-fallblatt

A Lightweight jQuery Plugin for Animating Split-Flap Displays | fallblatt

fallblatt is a lightweight jQuery plugin for animating split screens. This jQuery plugin allows you to include such offers in your web application. Everything from virtual departure…

bootstrap-5-dark-theme

Dark & Light Switch Mode Toggle for Bootstrap 5

Switching to dark mode is done by toggling HTML tags that include -dark or -light as a category. It is made by manipulating the DOM with JavaScript. The text color also changes depending…

jQuery-SyoTimer-Plugin

jQuery Plugin for Countdown Timer on HTML Page | SyoTimer

yoTimer jQuery plugin allows you to create digital style countdowns/periodic timers on the webpage, with callbacks support and timezone/translation customization. Features Periodic count with the specified period…

vue-js-periodic-table

Dynamic, Data-driven Periodic Table built with Vue.js

Periodicity is a dynamic, data-driven periodic table created with Vue.js that uses D3 animations and graphs to show the beauty of periodic trends. Built With vue.js (component…