- 前往:为现代 Web 而构建
为现代 Web 而构建
一套完整的设计系统,由 Tailwind CSS 和 Reka UI 提供支持,实现卓越的性能和可访问性。
- 前往:大型图标集
大型图标集
通过 @nuxt/icon 访问由 Iconify 提供的超过 200,000 个可自定义图标。
- 前往:简便的字体自定义
简便的字体自定义
通过对 @nuxt/fonts 的一流集成,实现性能优化的字体加载。
- 前往:明亮与深色模式
明亮与深色模式
组件预置深色模式支持,并与 @nuxtjs/color-mode 模块无缝集成。
- 前往:国际化 (i18n)
国际化 (i18n)
已翻译成 50 多种语言,完美兼容 i18n,并支持多向布局(LTR/RTL)。
- 前往:美观的排版
美观的排版
与 @nuxt/content 集成,提供美观的排版和一致的组件样式。
灵活的设计系统
利用 Nuxt UI 以 CSS 为核心的设计系统(由 Tailwind CSS 提供支持),通过语义化颜色系统和运行时配置,助您更快构建应用。
- 以 CSS 为核心的配置使用 @theme 指令在 CSS 中直接定义字体、颜色和断点。这使得您的主题具有可移植性、易维护且易于自定义。
- 语义化颜色系统配置 7 个语义化颜色别名(primary, secondary, success, info, warning, error, neutral),这些别名描述了颜色的用途而非具体数值。
- 运行时颜色配置无需重新构建应用程序,即可通过 AppConfig 在运行时更改颜色、图标等,非常适合多租户应用程序或动态主题定制。
@import "tailwindcss";
@import "@nuxt/ui";
@theme static {
--font-sans: 'Public Sans', system-ui, sans-serif;
--color-brand-50: #f0f9ff;
--color-brand-100: #e0f2fe;
--color-brand-200: #bae6fd;
--color-brand-300: #7dd3fc;
--color-brand-400: #38bdf8;
--color-brand-500: #3b82f6;
--color-brand-600: #2563eb;
--color-brand-700: #1d4ed8;
--color-brand-800: #1e40af;
--color-brand-900: #1e3a8a;
--color-brand-950: #172554;
}
export default defineAppConfig({
ui: {
colors: {
primary: 'brand',
secondary: 'purple',
success: 'green',
info: 'blue',
warning: 'yellow',
error: 'red',
neutral: 'zinc'
},
icons: {
loading: 'i-lucide-loader-circle',
search: 'i-lucide-search',
menu: 'i-lucide-menu'
}
}
})
一致的设计令牌
使用 CSS 变量作为设计令牌,结合语义化工具类,实现自适应明亮与深色模式的一致性主题。
- 语义化颜色工具类使用如 text-primary、bg-success 或 border-error 等工具类,它们可通过 CSS 变量自动适应明亮和深色模式。
- 文本和背景令牌提供完整的文本(text-dimmed, text-muted, text-highlighted)、背景(bg-default, bg-elevated, bg-accented)和边框工具类。
- 全局布局变量通过 --ui-radius 定制边框圆角、--ui-container 设置布局宽度、--ui-header-height 统一间距,从而自定义全局样式。
@import "tailwindcss";
@import "@nuxt/ui";
:root {
--ui-primary: black;
--ui-radius: 0.5rem;
--ui-container: var(--container-5xl);
--ui-header-height: --spacing(24);
}
.dark {
--ui-primary: white;
--ui-bg: var(--ui-color-neutral-950);
}
<template>
<div class="bg-default border border-default rounded-lg p-4">
<span class="text-primary">Primary text</span>
<span class="text-dimmed">Dimmed text</span>
<div class="bg-elevated p-3 rounded-md mt-2">
<span class="text-muted">Elevated background</span>
</div>
</div>
</template>
根据需求定制组件
使用 Tailwind Variants API,结合插槽(slots)、变体(variants)和复合变体(compound variants),实现强大的组件主题化及智能的类名合并。
- Tailwind Variants API组件通过插槽实现灵活样式,通过变体实现基于属性的样式,并通过复合变体实现复杂的条件样式,并支持智能类名合并。
- 全局主题配置在 app.config.ts 中全局覆盖组件主题,使用插槽、变体、复合变体和默认变体,确保应用各处样式的一致性。
- 组件级自定义使用 ui 属性微调单个组件的插槽样式,并使用 class 属性重写根元素,提供最大的灵活性。
export default defineAppConfig({
ui: {
button: {
slots: {
base: 'font-bold'
},
variants: {
size: {
md: {
base: 'px-4 py-2 text-sm'
}
}
},
defaultVariants: {
color: 'neutral'
}
}
}
})
<template>
<UButton
label="Button"
size="md"
variant="outline"
trailing-icon="i-lucide-chevron-right"
:ui="{
trailingIcon: 'rotate-90'
}"
class="rounded-full"
/>
</template>
使用生产就绪模板更快交付
从我们完全响应式、可访问且易于自定义的模板开始,让您快速、轻松地发布项目。
- 生产就绪模板所有模板均基于最佳实践构建,已进行 SEO 优化和性能调优,只需极简配置即可立即部署到生产环境。
- Nuxt 与 Vue 支持为 Nuxt 和 Vue 应用程序提供专用模板及框架特定优化,选择最适合您项目需求的一个。
- 完全可自定义基于 Nuxt UI 组件构建,支持完全的源代码访问,轻松自定义颜色、字体、布局和组件,以符合您的品牌标识。
加入 Nuxt UI 社区
加入我们蓬勃发展的开源社区,贡献代码、报告问题、建议功能或协助完善文档。每一次贡献都让 Nuxt UI 在生态系统中变得更美好。





















































