unocss-preset-nuxt-ui

The preset that makes using UnoCSS with Nuxt UI effortless
3,263 29
Install
npm install unocss-preset-nuxt-ui
Latest Version:4.0.6
Vue:3
License:MIT
Last Updated:Dec 20, 2025
Links: GitHub  ·  npm
Maintainer: lehuuphuc

UnoCSS Preset Nuxt UI npm

Features

  • This preset adds the necessary classes for Nuxt UI to function without tailwindcss.

Usage

bun i -D unocss-preset-nuxt-ui unocss @nuxt/ui
// uno.config.ts
import presetWind4 from '@unocss/preset-wind4';
import {
  defineConfig,
  transformerDirectives,
  transformerVariantGroup,
} from 'unocss';
import { presetNuxtUI, presetNuxtUIExtra } from 'unocss-preset-nuxt-ui';

export default defineConfig({
  content: {
    pipeline: {
      include: [
        /\.ts$/,
        /\.vue$/,
        /\.vue\?vue/,
      ],
    },
  },
  presets: [
    presetNuxtUI(), // must be before presetWind4
    presetWind4({
      preflights: { reset: true, theme: 'on-demand' },
      dark: { dark: '.dark', light: '.light' },
    }),
    presetNuxtUIExtra(), // must be after presetWind4
  ],
  transformers: [
    transformerDirectives(),
    transformerVariantGroup(),
  ],
  outputToCssLayers: true,
});
// main.scss // must use *.scss file to avoid conflict with tailwindcss
@use './keyframes.css'; // copy from node_modules/@nuxt/ui/dist/runtime/keyframes.css
// preflight nuxt-ui gap classes
.\[--gap\:--spacing\(4\)\] {
  --gap: calc(var(--spacing) * 4);
}
.\[--gap\:--spacing\(16\)\] {
  --gap: calc(var(--spacing) * 16);
}

Run playground

bun i
bun run build
bun play:prepare
bun play

Demo

link

License

MIT License © 2025 lehuuphuc

Related Packages

unocss-preset-fluid

A fluid preset for unocss

11,896 48
unocss-nuxt-ui

Use UnoCSS with Nuxt UI without Tailwind CSS

1,719 27
unocss-preset-formkit

A UnoCSS preset for FormKit variants.

31,951
unocss-preset-extra

UnoCSS 扩展, 提供类名简写及额外一些样式预设

203,422 60
unocss-preset-vuetify

UnoCSS preset that replicates Vuetify utility classes

52,732 12

Version History

Version Released Vue License
4.0.6 ^3.5.26 MIT
4.0.5 ^3.5.24 MIT
4.0.4 ^3.5.22 MIT
4.0.3 ^3.5.22 MIT
4.0.2 ^3.5.22 MIT