@vuecs/nuxt

Nuxt module for vuecs — auto-imports @vuecs/design tokens and ships SSR-safe color-mode, palette, and locale plugins. Theme-agnostic; dispatches palette/colorMode runtime hooks through whichever themes the consumer installs.
5,119 4
Install
npm install @vuecs/nuxt
Latest Version:1.2.1
Vue:3
License:Apache-2.0
Last Updated:Oct 16, 2026
Links: GitHub  ·  npm
Maintainer: tada5hi

@vuecs/nuxt

npm version CI license

The Nuxt module for vuecs — theme-agnostic, SSR-first. Dark mode, runtime palettes, and locale are rendered into the head before first paint, so there's no flash of the wrong theme, ever. One module covers Tailwind, Bootstrap, Bulma, and any palette-aware community theme.

✨ What's inside

  • 🌗 SSR-safe color mode — cookie-backed useColorMode() auto-import; the server emits html.dark / html.light plus per-theme attributes (data-bs-theme, data-theme) via each theme's colorMode.handle hook.
  • 🎨 SSR-safe palettes — cookie-backed useColorPalette(); the server renders the <style id="vc-color-palette"> block by walking installed themes' palette.handle renderers. CSP nonce supported.
  • 🌍 SSR-safe locale — cookie-backed locale plugin: resolves 'auto' from the request's Accept-Language on the server, bridges into Config['locale'], emits <html lang>; useLocale() + useLocaleManager() auto-imports.
  • 🎛️ Design tokens auto-injected — @vuecs/design's CSS ships automatically (opt out via injectTokens: false).
  • 🔌 Theme auto-install — list packages under vuecs: { themes: [...] } and the module generates the install plugin for you.
  • 🚪 Everything opt-out — colorMode: false, colorPalette: false, locale: false for apps that bring their own.

📦 Installation

npm install @vuecs/nuxt @vuecs/design @vuecs/theme-tailwind

⚡ Usage

// nuxt.config.ts
export default defineNuxtConfig({
    modules: ['@vuecs/nuxt'],
    vuecs: {
        themes: ['@vuecs/theme-tailwind'],
        colorMode: { value: 'system' },
        colorPalette: { value: { primary: 'green' } },
        cookie: { maxAge: 31536000, sameSite: 'lax' },
    },
});
<script setup>
const { resolved, toggle } = useColorMode();      // auto-imported
const { current, set } = useColorPalette();       // auto-imported
const { set: setLocale, reset } = useLocaleManager();  // auto-imported
</script>

📚 Documentation

Module reference · useColorMode · useColorPalette

License

Made with 💚

Published under Apache 2.0 License.

Related Packages

@pisandelli/daredash

Provides a design token-powered UI component library and styling system for Nuxt...

6,023 3
@7pmlabs/design-system-nuxt

Nuxt 4 module for @7pmlabs/design-system — auto-imports components, composables,...

2,840 1
@solar-icons/nuxt

Nuxt module for easily integrating Solar Icons into your Nuxt 3+ applications.

9,600 224
@pixela/voxel-ui-nuxt

Nuxt module for @pixela/voxel-ui

1,793 0
@smalt-ui/nuxt

Nuxt module for @smalt-ui/core: component auto-import, styles, color mode

451 0

Version History

Version Released Vue License
1.2.1 ^3.x Apache-2.0
1.2.0 ^3.x Apache-2.0
1.1.5 ^3.x Apache-2.0
1.1.4 ^3.x Apache-2.0
1.1.3 ^3.x Apache-2.0