diff --git a/docs/app/composables/useSharedData.ts b/docs/app/composables/useSharedData.ts
new file mode 100644
index 00000000..391698df
--- /dev/null
+++ b/docs/app/composables/useSharedData.ts
@@ -0,0 +1,23 @@
+import { createSharedComposable } from '@vueuse/core'
+
+function _useSharedData() {
+ const framework = useCookie('nuxt-ui-framework', { default: () => 'nuxt' })
+ const frameworks = computed(() => [{
+ label: 'Nuxt',
+ icon: 'i-logos-nuxt-icon',
+ value: 'nuxt',
+ onSelect: () => framework.value = 'nuxt'
+ }, {
+ label: 'Vue',
+ icon: 'i-logos-vue',
+ value: 'vue',
+ onSelect: () => framework.value = 'vue'
+ }].map(f => ({ ...f, active: framework.value === f.value })))
+
+ return {
+ framework,
+ frameworks
+ }
+}
+
+export const useSharedData = createSharedComposable(_useSharedData)
diff --git a/docs/app/layouts/docs.vue b/docs/app/layouts/docs.vue
index 41e98939..fcd68d79 100644
--- a/docs/app/layouts/docs.vue
+++ b/docs/app/layouts/docs.vue
@@ -10,6 +10,10 @@ const navigation = inject>('navigation')
+
+
+
+
diff --git a/docs/app/pages/[...slug].vue b/docs/app/pages/[...slug].vue
index 9d9f53c1..b8e53968 100644
--- a/docs/app/pages/[...slug].vue
+++ b/docs/app/pages/[...slug].vue
@@ -21,6 +21,28 @@ const navigation = inject>('navigation')
const breadcrumb = computed(() => mapContentNavigation(findPageBreadcrumb(navigation?.value, page.value)).map(({ icon, ...link }) => link))
+const { framework } = useSharedData()
+
+// Redirect to the correct framework version if the page is not the current framework
+if (!import.meta.prerender) {
+ watch(framework, () => {
+ if (page.value?.navigation?.framework && page.value?.navigation?.framework !== framework.value) {
+ if (route.path.endsWith(`/${page.value?.navigation?.framework}`)) {
+ navigateTo(`${route.path.split('/').slice(0, -1).join('/')}/${framework.value}`)
+ } else {
+ navigateTo(`/getting-started`)
+ }
+ }
+ })
+}
+
+// Update the framework if the page has a different framework
+watch(page, () => {
+ if (page.value?.navigation?.framework && page.value?.navigation?.framework !== framework.value) {
+ framework.value = page.value?.navigation?.framework as string
+ }
+}, { immediate: true })
+
useSeoMeta({
titleTemplate: '%s - Nuxt UI v3',
title: typeof page.value.navigation === 'object' && page.value.navigation.title ? page.value.navigation.title : page.value.title,
@@ -75,21 +97,6 @@ const communityLinks = computed(() => [{
-
-
-
-
+const colorMode = useColorMode()
+
+const isDark = computed({
+ get() {
+ return colorMode.value === 'dark'
+ },
+ set() {
+ colorMode.preference = colorMode.value === 'dark' ? 'light' : 'dark'
+ }
+})
+
+
+
+
+
+
+
+
+
+
+
+```
+
+You can disable the `@nuxtjs/color-mode` module with the `ui.colorMode` option in your `nuxt.config.ts`:
+
+```ts [nuxt.config.ts]
+export default defineNuxtConfig({
+ ui: {
+ colorMode: false
+ }
+})
+```
diff --git a/docs/content/1.getting-started/6.color-mode/2.vue.md b/docs/content/1.getting-started/6.color-mode/2.vue.md
new file mode 100644
index 00000000..da05f919
--- /dev/null
+++ b/docs/content/1.getting-started/6.color-mode/2.vue.md
@@ -0,0 +1,47 @@
+---
+title: Color Mode
+description: 'Nuxt UI integrates with VueUse to allow for easy switching between light and dark themes.'
+navigation.framework: vue
+---
+
+::callout{to="/getting-started/color-mode/nuxt" icon="i-logos-nuxt-icon" class="hidden"}
+Looking for the **Nuxt** version?
+::
+
+## Usage
+
+Nuxt UI automatically registers the [useDark](https://vueuse.org/core/useDark) composable as a Vue plugin, so there's no additional setup required. You can simply use it to switch between light and dark modes:
+
+```vue [ColorModeButton.vue]
+
+
+
+
+
+```
+
+You can disable this plugin with the `colorMode` option in your `vite.config.ts`:
+
+```ts [vite.config.ts]
+import { defineConfig } from 'vite'
+import vue from '@vitejs/plugin-vue'
+import ui from '@nuxt/ui/vite'
+
+export default defineConfig({
+ plugins: [
+ vue(),
+ ui({
+ colorMode: false
+ })
+ ]
+})
+```
diff --git a/docs/content/1.getting-started/7.i18n/.navigation.yml b/docs/content/1.getting-started/7.i18n/.navigation.yml
index 57a75c4e..ef175ce0 100644
--- a/docs/content/1.getting-started/7.i18n/.navigation.yml
+++ b/docs/content/1.getting-started/7.i18n/.navigation.yml
@@ -1 +1,2 @@
badge: New
+shadow: true
diff --git a/docs/content/1.getting-started/7.i18n/1.nuxt.md b/docs/content/1.getting-started/7.i18n/1.nuxt.md
index dbb49dbf..6366d2d8 100644
--- a/docs/content/1.getting-started/7.i18n/1.nuxt.md
+++ b/docs/content/1.getting-started/7.i18n/1.nuxt.md
@@ -1,20 +1,17 @@
---
-title: Internationalization (i18n) in a Nuxt app
+title: Internationalization (i18n)
description: 'Learn how to internationalize your Nuxt app with multi-directional support (LTR/RTL).'
-select:
- items:
- - label: Nuxt
- icon: i-logos-nuxt-icon
- to: /getting-started/i18n/nuxt
- - label: Vue
- icon: i-logos-vue
- to: /getting-started/i18n/vue
+navigation.framework: nuxt
---
+::callout{to="/getting-started/i18n/vue" icon="i-logos-vue" class="hidden"}
+Looking for the **Vue** version?
+::
+
## Usage
::note{to="/components/app"}
-Nuxt UI provides an [App](/components/app) component that wraps your app to provide global configurations.
+Nuxt UI provides an **App** component that wraps your app to provide global configurations.
::
### Locale
diff --git a/docs/content/1.getting-started/7.i18n/2.vue.md b/docs/content/1.getting-started/7.i18n/2.vue.md
index f71a9421..258a2c3e 100644
--- a/docs/content/1.getting-started/7.i18n/2.vue.md
+++ b/docs/content/1.getting-started/7.i18n/2.vue.md
@@ -1,20 +1,17 @@
---
-title: Internationalization (i18n) in a Vue app
+title: Internationalization (i18n)
description: 'Learn how to internationalize your Vue app with multi-directional support (LTR/RTL).'
-select:
- items:
- - label: Nuxt
- icon: i-logos-nuxt-icon
- to: /getting-started/i18n/nuxt
- - label: Vue
- icon: i-logos-vue
- to: /getting-started/i18n/vue
+navigation.framework: vue
---
+::callout{to="/getting-started/i18n/nuxt" icon="i-logos-nuxt-icon" class="hidden"}
+Looking for the **Nuxt** version?
+::
+
## Usage
::note{to="/components/app"}
-Nuxt UI provides an [App](/components/app) component that wraps your app to provide global configurations.
+Nuxt UI provides an **App** component that wraps your app to provide global configurations.
::
### Locale
diff --git a/docs/content/3.components/0.app.md b/docs/content/3.components/0.app.md
index 5d1ca731..d4e28889 100644
--- a/docs/content/3.components/0.app.md
+++ b/docs/content/3.components/0.app.md
@@ -27,8 +27,16 @@ Use it as at the root of your app:
```
-::tip{to="/getting-started/i18n/nuxt#locale"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/i18n/nuxt#locale"}
Learn how to use the `locale` prop to change the locale of your app.
+:::
+
+#vue
+:::tip{to="/getting-started/i18n/vue#locale"}
+Learn how to use the `locale` prop to change the locale of your app.
+:::
::
## API
diff --git a/docs/content/3.components/accordion.md b/docs/content/3.components/accordion.md
index ec29392d..e1d296a4 100644
--- a/docs/content/3.components/accordion.md
+++ b/docs/content/3.components/accordion.md
@@ -168,8 +168,16 @@ props:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.chevronDown` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.chevronDown` key.
+:::
::
## Examples
diff --git a/docs/content/3.components/alert.md b/docs/content/3.components/alert.md
index f4263070..d792a5d5 100644
--- a/docs/content/3.components/alert.md
+++ b/docs/content/3.components/alert.md
@@ -178,8 +178,16 @@ props:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.close` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.close` key.
+:::
::
### Actions
diff --git a/docs/content/3.components/breadcrumb.md b/docs/content/3.components/breadcrumb.md
index ba857a92..26ba14d2 100644
--- a/docs/content/3.components/breadcrumb.md
+++ b/docs/content/3.components/breadcrumb.md
@@ -67,8 +67,16 @@ props:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.chevronRight` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.chevronRight` key.
+:::
::
## Examples
diff --git a/docs/content/3.components/button.md b/docs/content/3.components/button.md
index c9fbed63..81e534d6 100644
--- a/docs/content/3.components/button.md
+++ b/docs/content/3.components/button.md
@@ -197,8 +197,16 @@ slots:
Button
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.loading` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.loading` key.
+:::
::
### Disabled
diff --git a/docs/content/3.components/carousel.md b/docs/content/3.components/carousel.md
index adf3e4a5..0a17390f 100644
--- a/docs/content/3.components/carousel.md
+++ b/docs/content/3.components/carousel.md
@@ -94,8 +94,16 @@ options:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize these icons globally in your `app.config.ts` under `ui.icons.arrowLeft` / `ui.icons.arrowRight` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize these icons globally in your `vite.config.ts` under `ui.icons.arrowLeft` / `ui.icons.arrowRight` key.
+:::
::
### Dots
diff --git a/docs/content/3.components/checkbox.md b/docs/content/3.components/checkbox.md
index c1e68e6b..3d5e040b 100644
--- a/docs/content/3.components/checkbox.md
+++ b/docs/content/3.components/checkbox.md
@@ -58,8 +58,16 @@ props:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.minus` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.minus` key.
+:::
::
### Label
@@ -115,8 +123,16 @@ props:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.check` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.check` key.
+:::
::
### Color
diff --git a/docs/content/3.components/command-palette.md b/docs/content/3.components/command-palette.md
index 0832d177..4ed5252a 100644
--- a/docs/content/3.components/command-palette.md
+++ b/docs/content/3.components/command-palette.md
@@ -216,8 +216,16 @@ props:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.search` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.search` key.
+:::
::
### Loading
@@ -277,8 +285,16 @@ props:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.loading` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.loading` key.
+:::
::
### Disabled
@@ -404,8 +420,16 @@ props:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.close` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.close` key.
+:::
::
## Examples
diff --git a/docs/content/3.components/icon.md b/docs/content/3.components/icon.md
index ff3b4886..785096ca 100644
--- a/docs/content/3.components/icon.md
+++ b/docs/content/3.components/icon.md
@@ -1,14 +1,15 @@
---
-description: A wrapper around Nuxt Icon component to display icons.
+description: A component to display any icon from Iconify.
links:
- - label: Nuxt Icon
- icon: i-simple-icons-github
- to: https://github.com/nuxt/icon
+ - label: IcĂ´nes
+ to: https://icones.js.org/
+ target: _blank
+ icon: i-custom-icones-js
---
## Usage
-You can use any name from the https://icones.js.org collection:
+Use the `name` prop to display an icon:
::component-code
---
@@ -18,8 +19,11 @@ props:
---
::
-::tip
-It's highly recommended to install the icons collections you need, read more about this in [Icons](/getting-started/icons#collections).
+::framework-only
+#nuxt
+:::caution{to="/getting-started/icons/nuxt#collections"}
+It's highly recommended to install the icons collections you need, read more about this.
+:::
::
## API
diff --git a/docs/content/3.components/input-menu.md b/docs/content/3.components/input-menu.md
index 019cae31..5254414b 100644
--- a/docs/content/3.components/input-menu.md
+++ b/docs/content/3.components/input-menu.md
@@ -189,8 +189,16 @@ props:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.close` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.close` key.
+:::
::
### Placeholder
@@ -441,8 +449,16 @@ props:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.chevronDown` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.chevronDown` key.
+:::
::
### Selected Icon
@@ -470,8 +486,16 @@ props:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.check` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.check` key.
+:::
::
### Avatar
@@ -550,8 +574,16 @@ props:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.loading` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.loading` key.
+:::
::
### Disabled
diff --git a/docs/content/3.components/input.md b/docs/content/3.components/input.md
index d52b8af1..421c96e7 100644
--- a/docs/content/3.components/input.md
+++ b/docs/content/3.components/input.md
@@ -184,8 +184,16 @@ props:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.loading` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.loading` key.
+:::
::
### Disabled
@@ -290,7 +298,7 @@ name: 'input-form-field-example'
::
::tip{to="/components/form"}
-It also provides validation and error handling when used within a [Form](/components/form) component.
+It also provides validation and error handling when used within a **Form** component.
::
### Within a ButtonGroup
diff --git a/docs/content/3.components/modal.md b/docs/content/3.components/modal.md
index 50ae5396..8e73101f 100644
--- a/docs/content/3.components/modal.md
+++ b/docs/content/3.components/modal.md
@@ -156,8 +156,16 @@ slots:
:placeholder{class="h-48"}
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.close` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.close` key.
+:::
::
### Overlay
diff --git a/docs/content/3.components/navigation-menu.md b/docs/content/3.components/navigation-menu.md
index a8764c24..935d6150 100644
--- a/docs/content/3.components/navigation-menu.md
+++ b/docs/content/3.components/navigation-menu.md
@@ -434,8 +434,16 @@ props:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.chevronDown` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.chevronDown` key.
+:::
::
### Arrow
diff --git a/docs/content/3.components/select-menu.md b/docs/content/3.components/select-menu.md
index 5dd514fc..1de5a7cf 100644
--- a/docs/content/3.components/select-menu.md
+++ b/docs/content/3.components/select-menu.md
@@ -482,8 +482,16 @@ props:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.chevronDown` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.chevronDown` key.
+:::
::
### Selected Icon
@@ -513,8 +521,16 @@ props:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.check` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.check` key.
+:::
::
### Avatar
@@ -599,8 +615,16 @@ props:
---
::
-::tip{to="/getting-started/icons#theme"}
+::framework-only
+#nuxt
+:::tip{to="/getting-started/icons/nuxt#theme"}
You can customize this icon globally in your `app.config.ts` under `ui.icons.loading` key.
+:::
+
+#vue
+:::tip{to="/getting-started/icons/vue#theme"}
+You can customize this icon globally in your `vite.config.ts` under `ui.icons.loading` key.
+:::
::
### Disabled
diff --git a/docs/content/3.components/select.md b/docs/content/3.components/select.md
index 0996fcee..f4ffb084 100644
--- a/docs/content/3.components/select.md
+++ b/docs/content/3.components/select.md
@@ -206,7 +206,7 @@ props:
::
::note{to="https://www.radix-vue.com/components/select.html#change-the-positioning-mode"}
-Read more about the `content.position` prop in the [Radix Vue documentation](https://www.radix-vue.com/components/select.html#change-the-positioning-mode).
+Read more about the `content.position` prop in the **Radix Vue** documentation.
::