Vue Bits
repository·main·Indexed 26 days ago
https://github.com/davidhdev/vue-bitsA library of over 90+ animated VueJS UI components, including text animations, backgrounds, and interactive elements. Designed as the official Vue port of React Bits, it integrates with Vue and Nuxt projects. Components can be installed individually via the jsrepo or shadcn CLI using the registry at https://vue-bits.dev/r.
What's inside vue-bits
- Vue Bits is a large collection of animated VueJS UI components, serving as the official Vue port of React Bits. It provides over 90+ components including text animations, backgrounds, and general UI elements designed to be highly customizable via props and easy to integrate into modern Vue or Nuxt projects.
Install Vue Bits components via CLI
mainVue Bits uses
jsrepoto install individual components into your project. Instead of installing a single monolithic package, you can use the CLI to add specific components as needed.To find the exact installation command for a specific component, visit the component's dedicated page in the official documentation at vue-bits.dev.
Install dependencies for ModelViewer
mainTo use the
ModelViewercomponent, you must installthree,@tresjs/core, and@tresjs/cientos.npm install three @tresjs/core @tresjs/cientosInstall dependencies for the Masonry component
mainThe Masonry component requires
gsapto handle animations and layout transitions.npm install gsapInstall dependencies for BlobCursor
mainThe
BlobCursorcomponent requiresgsapfor its animations. Install it using npm:npm install gsapInstall dependencies for FlowingMenu
mainThe
FlowingMenucomponent requiresgsapto be installed in your project.npm install gsapConfigure the vue-bits registry with jsrepo
mainTo use
vue-bitscomponents withjsrepo, you must first initialize the registry in your project. Pointjsrepo initto theREGISTRY_BASEURL. After initialization, you can add items using thejsrepo addcommand.Registry Base URL:
https://vue-bits.dev/rConfigure the @vue-bits registry via jsrepo.config.ts
mainThe
@vue-bitsregistry is configured usingdefineConfigfromjsrepo. The configuration defines the registry's metadata, excluded dependencies, output formats, and the collection of components available in the registry.Key configuration properties within the
registryobject include:name: The unique identifier for the registry (e.g.,@vue-bits).description: A summary of the registry's purpose.excludeDeps: An array of dependencies to exclude from registry processing (e.g.,['vue']).outputs: An array of output configurations that define how registry items are transformed and written to disk. This project uses@jsrepo/shadcnand a customcomponentDependenciesOutput.items: An array ofRegistryItemobjects representing the components available in the registry.
import { output as shadcnOutput } from '@jsrepo/shadcn'; import { defineConfig, RegistryItem } from 'jsrepo'; import { componentDependenciesOutput } from './scripts/component-dependencies-output'; export default defineConfig({ registry: { name: '@vue-bits', description: 'An open source collection of animated, interactive & fully customizable Vue components...', homepage: 'https://vue-bits.dev', authors: ['David Haz'], bugs: 'https://github.com/DavidHDev/vue-bits/issues', repository: 'https://github.com/DavidHDev/vue-bits', tags: ['vue', 'javascript', 'components', 'tailwind'], excludeDeps: ['vue'], outputs: [ shadcnOutput({ dir: 'public/r', format: true }), componentDependenciesOutput({ path: 'src/constants/componentDependencies.ts' }) ], items: [ // Array of RegistryItem objects ] } });Configure vue-bits in components.json for MCP/Multi-registry
mainFor setups using a
components.jsonfile (common in MCP or multi-registry environments), add the@vue-bitsnamespace to yourregistriesconfiguration. This allows the CLI to resolve components via the vue-bits registry.Configuration Object:
{ "registries": { "@vue-bits": "https://vue-bits.dev/r/{name}.json" } }Use the ModelViewer component
mainThe
ModelViewercomponent allows you to render 3D models (such as.glbfiles) within a container. It supports props forurl,width,height, andmax-zoom-distance, and emits a@model-loadedevent when the model is ready.<template> <div class="h-[400px]"> <ModelViewer url="https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/main/2.0/ToyCar/glTF-Binary/ToyCar.glb" width="100%" height="100%" :max-zoom-distance="0.7" @model-loaded="onModelLoaded" /> </div> </template> <script setup lang="ts"> import ModelViewer from './ModelViewer.vue'; const onModelLoaded = () => { console.log('Model loaded!'); }; </script>Add a vue-bits snippet using jsrepo
mainYou can add a specific component (snippet) to your project using the
jsrepo addcommand. The command is constructed using your preferred package manager's runner (e.g.,npx,pnpm dlx) followed by the registry URL for the specific component slug.Command Pattern:
<runner> jsrepo add https://vue-bits.dev/r/<slug>.jsonUse the LiquidEther background component
mainThe
LiquidEthercomponent provides a dynamic, interactive background effect. It requires thethreepackage for its underlying 3D rendering.Installation
npm install threeUsage
Import the component and pass configuration props to control colors, mouse interaction, and automatic animation settings. To ensure the background is visible, wrap it in a container with a defined width and height.
<template> <div style=" width: 100%; height: 600px; position: relative; " > <LiquidEther :colors="['#5227FF', '#FF9FFC', '#B497CF']" :mouse-force="20" :cursor-size="100" :is-viscous="false" :viscous="30" :iterations-viscous="32" :iterations-poisson="32" :resolution="0.5" :is-bounce="false" :auto-demo="true" :auto-speed="0.5" :auto-intensity="2.2" :takeover-duration="0.25" :auto-resume-delay="3000" :auto-ramp-duration="0.6" /> </div> </template> <script setup lang="ts"> import LiquidEther from './LiquidEther.vue' </script>