Vue Horizontal is a dedicated Vue.js component designed to simplify the creation of horizontal, scrollable layouts for modern responsive web applications. It offers a pure Vue-native solution, avoiding direct DOM manipulation or external legacy JavaScript libraries, requiring only Vue as a peer dependency. The library explicitly supports all rendering modes including Single Page Applications (SPA), Server-Side Rendering (SSR), and Static Site Generation (SSG), with comprehensive end-to-end testing. Currently stable at version 0.8.13, it primarily supports Vue 2, while a Vue 3 compatible version is available under the `@next` tag. The project maintains an active release cadence, with frequent bug fixes and maintenance updates. Key differentiators include its lightweight footprint (approximately 3 KB on CDN), mobile-first design philosophy, customizable navigation options, and high extensibility, granting developers full control over HTML structure, CSS styling, and interaction logic to achieve desired UX patterns like smooth scrolling and snapping.
npm install vue-horizontalVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing and using VueHorizontal with a v-for loop to render a dynamic list of items.
For Vue 3 projects, use `npm install vue-horizontal@next` or `yarn add vue-horizontal@next`.
Check for the presence of `$refs` or use `this.$nextTick` for DOM manipulations. Ensure your SSR environment correctly handles component lifecycle.
Ensure your custom CSS does not override critical layout properties applied by the component. Refer to the documentation's design principles for best practices.
Update to the latest `0.8.x` version to ensure `refresh` callback optionality. Check documentation for the current `refresh` signature if manually calling it.
Ensure `import VueHorizontal from 'vue-horizontal';` is present and the component is added to `components: { VueHorizontal }` in your Vue component or globally via `Vue.component('VueHorizontal', VueHorizontal);`.Guard `$refs` access with `if (this.$refs.container)` or defer DOM-dependent logic to `mounted()` lifecycle hook or `this.$nextTick()` callback.
Use ESM `import` statements: `import VueHorizontal from 'vue-horizontal';`. Ensure your build setup (Webpack, Rollup, Vite) is configured to handle ESM correctly.