Skip to content

Search documentation

Search guides, examples, and component APIs.

Quick links
↑↓ NavigateEnter OpenEsc Close
Get started

Documentation navigation

← All frameworks

Installation

Nuxt

Start a Nuxt 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 Nuxt 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 Nuxt project

Create a folder named my-app. The next command moves into it and installs the project packages.

Create the app
bun create nuxt@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

Create app/assets/css/main.css with this import:

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

Merge this minimal setup into the fresh nuxt.config.ts. It loads the CSS on every page and runs the Tailwind plugin.

nuxt.config.ts
import tailwindcss from '@tailwindcss/vite'

export default defineNuxtConfig({
  css: ['~/assets/css/main.css'],
  vite: { plugins: [tailwindcss()] },
})

3. Add your first component

Run this inside my-app. The Weini CLI copies Button into app/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 app/app.vue with this small page. The import points to the Button file the CLI just copied.

app/app.vue
<template>
  <main class="p-8">
    <UiButton>Save changes</UiButton>
  </main>
</template>

4. Run the app

Start Nuxt 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 app/assets/css/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 app/assets/css/main.css
/* Add below the imports in app/assets/css/main.css. */
:root {
  --radius: 0.75rem;
}

Continue with the theming guide or explore the Button API.

Optional: Nuxt routes and advanced components

When a Weini control changes pages, let NuxtLink handle the destination.

Nuxt route links
<script setup lang="ts">
import { NuxtLink } from '#components'
</script>

<template>
  <UiLink :as="NuxtLink" to="/docs">Read the docs</UiLink>
  <UiButton :as="NuxtLink" to="/start">Get started</UiButton>
</template>

A dialog trigger can share one native button with Weini's Button styling.

Dialog trigger
<script setup lang="ts">
import Dialog from '~/components/ui/dialog/Dialog.vue'
import DialogTrigger from '~/components/ui/dialog/DialogTrigger.vue'
import DialogContent from '~/components/ui/dialog/DialogContent.vue'
import DialogTitle from '~/components/ui/dialog/DialogTitle.vue'
</script>

<template>
  <Dialog>
    <DialogTrigger as-child><UiButton variant="outline">Open settings</UiButton></DialogTrigger>
    <DialogContent><DialogTitle>Settings</DialogTitle></DialogContent>
  </Dialog>
</template>

Pagination can keep the selected page in the URL.

Route pagination
<script setup lang="ts">
import { NuxtLink } from '#components'
import { computed } from 'vue'
const route = useRoute()
const currentPage = computed(() => Number(route.query.page ?? 1))
const messages = { navigation: 'Results pages', previous: 'Previous', next: 'Next', page: (n: number) => 'Page ' + n }
</script>

<template>
  <UiPagination :model-value="currentPage" :total-pages="20" :messages="messages"
    :link-as="NuxtLink" :page-to="page => ({ query: { ...route.query, page } })" />
</template>

Setup references: Nuxt installation and Tailwind for Nuxt.