Skip to content

Search documentation

Search guides, examples, and component APIs.

Quick links
↑↓ NavigateEnter OpenEsc Close
Get started

Documentation navigation

← All frameworks

Installation

Vue with Vite

Start a Vue app, add Tailwind CSS, and put your first Weini Button on the page. We recommend Node.js 24.15 or newer for the app toolchain. The Weini CLI itself supports Node.js 22+ or Bun 1.3+.

Add to an existing Vue with Vite app

Run the CLI from your project root. Keep your existing configuration, routes, aliases, plugins and stylesheet rules. Setup adds the Tailwind Vite plugin, theme imports and compatible dependencies after validating the complete plan.

Configure the existing app
bunx --bun @getweini/cli@latest init
Add Button
bunx --bun @getweini/cli@latest add button

For Nuxt, the Tailwind plugin belongs in vite.plugins, not the application plugins list. For Vite, keep vue() and your other plugins in the same array. Append CSS imports to your existing stylesheet; do not replace it.

Dynamic configuration factories and ambiguous spreads require a manual merge. The CLI stops before writing and shows the exact patch. Re-run setup after merging, then run weini doctor. Read ownership and updates for compatibility and conflict handling.

Start a fresh project

1. Create a Vue project

Create a folder named my-app. When Vue asks about options, choose TypeScript. You can leave the other optional features off for this example.

Create the app
bun create vue@latest my-app
Enter the folder and install
cd my-app bun install

2. Add Tailwind CSS

Tailwind reads the classes used by Weini components and creates their CSS. Install Tailwind and its Vite plugin.

Install Tailwind CSS 4
bun add -d tailwindcss @tailwindcss/vite

In this fresh starter, add this import to src/assets/main.css. The Vue starter already loads this file from src/main.ts.

src/assets/main.css
@import 'tailwindcss';

For this fresh starter, merge this setup into vite.config.ts. Keep the Vue plugin and add Tailwind beside it.

vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwindcss from '@tailwindcss/vite'

export default defineConfig({
  plugins: [vue(), tailwindcss()],
})

3. Add your first component

Run this inside my-app. The Weini CLI copies Button into src/components/ui/button, adds the theme to your CSS, and records the installed version in weini.json.

Add Button
bunx --bun @getweini/cli@latest add button

Replace src/App.vue with this small page. The import points to the Button file the CLI just copied.

src/App.vue
<script setup lang="ts">
import Button from './components/ui/button/Button.vue'
</script>

<template>
  <main class="p-8">
    <Button>Save changes</Button>
  </main>
</template>

4. Run the app

Start Vite and open the local URL shown in your terminal. You should see a “Save changes” button.

Start the development server
bun run dev

5. Try a theme change

The CLI added Weini theme imports to src/assets/main.css. Add this rule at the bottom of that file. The Button corners become rounder because components read the shared --radius value.

Add to src/assets/main.css
/* Add below the imports in src/assets/main.css. */
:root {
  --radius: 0.75rem;
}

Continue with the theming guide or explore the Button API.

Setup references: Vue quick start and Tailwind with Vite.