+
+
+
+
+
diff --git a/docs/composables/useContentSource.ts b/docs/composables/useContentSource.ts
index 552c3f1d..a378c0db 100644
--- a/docs/composables/useContentSource.ts
+++ b/docs/composables/useContentSource.ts
@@ -4,27 +4,59 @@ export const useContentSource = () => {
const config = useRuntimeConfig().public
const branches = computed(() => [{
- id: 'dev',
- name: 'dev',
- icon: 'i-heroicons-cube',
- suffix: 'dev',
- label: 'Edge',
- disabled: route.path.startsWith('/dev'),
- click: () => select({ name: 'dev' })
- }, {
id: 'main',
name: 'main',
+ label: 'nuxt/ui',
icon: 'i-heroicons-cube',
- suffix: 'latest',
- label: `v${config.version}`,
- disabled: !route.path.startsWith('/dev'),
+ suffix: `v${config.version}`,
click: () => select({ name: 'main' })
+ }, {
+ id: 'dev',
+ name: 'dev',
+ label: 'nuxt/ui-edge',
+ icon: 'i-heroicons-cube-transparent',
+ suffix: 'dev',
+ click: () => select({ name: 'dev' })
+ }, {
+ id: 'pro',
+ name: 'pro',
+ label: 'nuxt/ui-pro',
+ icon: 'i-heroicons-cube',
+ suffix: `v${config.proVersion}`,
+ click: () => select({ name: 'pro' })
+ }, {
+ id: 'pro-edge',
+ name: 'pro-edge',
+ label: 'nuxt/ui-pro-edge',
+ icon: 'i-heroicons-cube-transparent',
+ suffix: 'dev',
+ disabled: true,
+ click: () => select({ name: 'pro-dev' })
}])
- const branch = computed(() => branches.value.find(b => b.name === (route.path.startsWith('/dev') ? 'dev' : 'main')))
+ const branch = computed(() => branches.value.find(b => b.name === (route.path.startsWith('/dev') ? 'dev' : route.path.startsWith('/pro') ? 'pro' : 'main')))
- function select (branch) {
- if (branch.name === 'dev') {
+ function select (b) {
+ if (b.name === branch.value.name) {
+ return
+ }
+
+ if (b.name === 'pro') {
+ router.push('/pro/getting-started')
+ return
+ }
+
+ if (branch.value.name === 'pro') {
+ if (b.name === 'dev') {
+ router.push('/dev/getting-started')
+ } else {
+ router.push('/getting-started')
+ }
+
+ return
+ }
+
+ if (b.name === 'dev') {
if (route.path.startsWith('/dev')) {
return
}
@@ -37,7 +69,6 @@ export const useContentSource = () => {
return {
branches,
- branch,
- select
+ branch
}
}
diff --git a/docs/content/1.getting-started/1.index.md b/docs/content/1.getting-started/1.index.md
index 6cd8d978..88a00ead 100644
--- a/docs/content/1.getting-started/1.index.md
+++ b/docs/content/1.getting-started/1.index.md
@@ -3,11 +3,9 @@ title: Introduction
description: 'Fully styled and customizable components for Nuxt.'
---
-This module has been developed by the [NuxtLabs](https://nuxtlabs.com/) team for [Volta](https://volta.net) and [Nuxt Studio](https://nuxt.studio/), its goal is to provide everything related to UI when building a Nuxt app. This includes components, icons, colors, dark mode but also keyboard shortcuts.
+Nuxt UI is a module that provides a set of Vue components and composables built with [Tailwind CSS](https://tailwindcss.com/) and [Headless UI](https://headlessui.dev/) to help you build beautiful and accessible user interfaces.
-::callout{icon="i-heroicons-light-bulb"}
-[Volta](https://volta.net/) entire UI is built with this module alongside the 50+ keyboard shortcuts defined.
-::
+Its goal is to provide everything related to UI when building a Nuxt app. This includes components, icons, colors, dark mode but also keyboard shortcuts.
## Features
diff --git a/docs/content/1.getting-started/2.installation.md b/docs/content/1.getting-started/2.installation.md
index 1774227d..a2b2ba7f 100644
--- a/docs/content/1.getting-started/2.installation.md
+++ b/docs/content/1.getting-started/2.installation.md
@@ -1,8 +1,9 @@
---
-description: 'Learn how to install and configure the module in your Nuxt app.'
+title: Installation
+description: 'Learn how to install and configure Nuxt UI in your application.'
---
-## Quick Start
+## Setup
1. Install `@nuxt/ui` dependency to your project:
@@ -91,7 +92,7 @@ You can read more about this in the [Theming](/getting-started/theming#dark-mode
This module is installed when using the `dynamic` prop on the `Icon` component or globally through the `ui.icons.dynamic` option in your `app.config.ts`.
::callout{icon="i-heroicons-light-bulb"}
-You can read more about this in the [Theming](/getting-started/theming#dynamic-icons) section and on the [Icon](/elements/icon) component page.
+You can read more about this in the [Theming](/getting-started/theming#dynamic-icons) section and on the [Icon](/components/icon) component page.
::
## TypeScript
diff --git a/docs/content/1.getting-started/3.theming.md b/docs/content/1.getting-started/3.theming.md
index 130051c1..65a6c557 100644
--- a/docs/content/1.getting-started/3.theming.md
+++ b/docs/content/1.getting-started/3.theming.md
@@ -2,8 +2,6 @@
description: 'Learn how to customize the look and feel of the components.'
---
-## Overview
-
This module relies on Nuxt [App Config](https://nuxt.com/docs/guide/directory-structure/app-config#app-config-file) file to customize the look and feel of the components at runtime with HMR (hot-module-replacement).
## Colors
@@ -70,7 +68,7 @@ The `primary` color also has a `DEFAULT` shade that changes based on the theme.
### Smart Safelisting
-Components having a `color` prop like [Avatar](/elements/avatar#chip), [Badge](/elements/badge#style), [Button](/elements/button#style), [Input](/forms/input#style) (inherited in [Select](/forms/select) and [SelectMenu](/forms/select-menu)), [RadioGroup](/forms/radio-group), [Checkbox](/forms/checkbox), [Toggle](/forms/toggle), [Range](/forms/range) and [Notification](/overlays/notification#timeout) will use the `primary` color by default but will handle all the colors defined in your `tailwind.config.ts` or the default Tailwind CSS colors.
+Components having a `color` prop like [Avatar](/components/avatar#chip), [Badge](/components/badge#style), [Button](/components/button#style), [Input](/components/input#style) (inherited in [Select](/components/select) and [SelectMenu](/components/select-menu)), [RadioGroup](/components/radio-group), [Checkbox](/components/checkbox), [Toggle](/components/toggle), [Range](/components/range) and [Notification](/components/notification#timeout) will use the `primary` color by default but will handle all the colors defined in your `tailwind.config.ts` or the default Tailwind CSS colors.
Variant classes of those components are defined with a syntax like `bg-{color}-500 dark:bg-{color}-400` so they can be used with any color. However, this means that Tailwind will not find those classes and therefore will not generate the corresponding CSS.
@@ -227,10 +225,6 @@ All the components are styled with dark mode in mind.
Thanks to [Tailwind CSS dark mode](https://tailwindcss.com/docs/dark-mode#toggling-dark-mode-manually) class strategy and the [@nuxtjs/color-mode](https://github.com/nuxt-modules/color-mode) module, you literally have nothing to do.
-::callout{icon="i-heroicons-puzzle-piece"}
-Learn how to build a color mode button in the [Examples](/getting-started/examples#color-mode-button) page.
-::
-
You can disable dark mode by setting the `preference` to `light` instead of `system` in your `nuxt.config.ts`.
```ts [nuxt.config.ts]
@@ -245,6 +239,42 @@ export default defineNuxtConfig({
If you're stuck in dark mode even after changing this setting, you might need to remove the `nuxt-color-mode` entry from your browser's local storage.
::
+You can easily build a color mode button by using the `useColorMode` composable from `@nuxtjs/color-mode`.
+
+::component-example
+#default
+:color-mode-button
+
+#code
+```vue
+
+
+
+
+
+
+
+
+
+```
+::
+
## Icons
You can use any icon (100,000+) from [Iconify](https://iconify.design/).
@@ -257,7 +287,7 @@ Some components have an `icon` prop that allows you to add an icon to the compon
```
-You can also use the [Icon](/elements/icon) component to add an icon anywhere in your app by following this pattern: `i-{collection_name}-{icon_name}`.
+You can also use the [Icon](/components/icon) component to add an icon anywhere in your app by following this pattern: `i-{collection_name}-{icon_name}`.
```vue
@@ -347,7 +377,7 @@ export default defineNuxtConfig({
The `Icon` component also has a `dynamic` prop to use the [nuxt-icon](https://github.com/nuxt-modules/icon/) module instead of the [@egoist/tailwindcss-icons](https://github.com/egoist/tailwindcss-icons#plugin-options) plugin.
-Read more about this in the [Icon](/elements/icon#dynamic) component page.
+Read more about this in the [Icon](/components/icon#dynamic) component page.
### Defaults
diff --git a/docs/content/1.getting-started/4.shortcuts.md b/docs/content/1.getting-started/4.shortcuts.md
index a6eb62c8..65dfce63 100644
--- a/docs/content/1.getting-started/4.shortcuts.md
+++ b/docs/content/1.getting-started/4.shortcuts.md
@@ -2,15 +2,13 @@
description: 'Learn how to display and define keyboard shortcuts in your app.'
---
-## Overview
-
-Some components like [Dropdown](/elements/dropdown), [Command Palette](/navigation/command-palette) and [Tooltip](/overlays/tooltip) support the display of keyboard shortcuts.
+Some components like [Dropdown](/components/dropdown), [Command Palette](/components/command-palette) and [Tooltip](/components/tooltip) support the display of keyboard shortcuts.
```vue
```
-Shortcuts are displayed and styled through the [Kbd](/elements/kbd) component.
+Shortcuts are displayed and styled through the [Kbd](/components/kbd) component.
```vue
diff --git a/docs/content/1.getting-started/5.examples.md b/docs/content/1.getting-started/5.examples.md
deleted file mode 100644
index 0635ad88..00000000
--- a/docs/content/1.getting-started/5.examples.md
+++ /dev/null
@@ -1,182 +0,0 @@
----
-title: Examples
-description: Discover some real-life examples of components you can build.
----
-
-::callout{icon="i-heroicons-wrench-screwdriver"}
-If you have any ideas of examples you'd like to see, please comment on [this issue](https://github.com/nuxt/ui/issues/297).
-::
-
-## Components
-
-You can mix and match components to build your own UI.
-
-### ColorModeButton
-
-You can easily build a color mode button by using the `useColorMode` composable from `@nuxtjs/color-mode`.
-
-::component-example
-#default
-:color-mode-button
-
-#code
-```vue
-
-
-
-
-
-
-
-
-
-
-
-```
-::
-
-### DatePicker
-
-Here is an example of a date picker component built with [v-calendar](https://github.com/nathanreyes/v-calendar).
-
-```vue [components/DatePicker.vue]
-
-
-
-
-
-```
-
-You can use it inside a [Popover](/overlays/popover) component to display it when clicking on a [Button](/elements/button).
-
-:component-example{component="date-picker-example"}
-
-### Table
-
-Here is an example of a Table component with all its features implemented.
-
-:component-example{component="table-example-advanced" hiddenCode :padding="false" }
-
-::callout{icon="i-simple-icons-github" to="https://github.com/nuxt/ui/blob/dev/docs/components/content/examples/TableExampleAdvanced.vue" target="_blank"}
-Take a look at the component!
-::
-
-## Theming
-
-Our theming system provides a lot of flexibility to customize the components.
-
-### CommandPalette
-
-Here is some examples of what you can do with the [CommandPalette](/navigation/command-palette).
-
-#### Algolia
-
-::component-example
----
-padding: false
-component: 'command-palette-example-theme-algolia'
-componentProps:
- class: 'max-h-[480px] rounded-md'
-hiddenCode: true
----
-::
-
-::callout{icon="i-simple-icons-github" to="https://github.com/nuxt/ui/blob/dev/docs/components/content/examples/CommandPaletteExampleThemeAlgolia.vue#L23" target="_blank"}
-Take a look at the component!
-::
-
-#### Raycast
-
-::component-example
----
-padding: false
-component: 'command-palette-example-theme-raycast'
-componentProps:
- class: 'max-h-[480px] rounded-md'
-hiddenCode: true
----
-::
-
-::callout{icon="i-simple-icons-github" to="https://github.com/nuxt/ui/blob/dev/docs/components/content/examples/CommandPaletteExampleThemeRaycast.vue#L30" target="_blank"}
-Take a look at the component!
-::
-
-### VerticalNavigation
-
-:component-example{component="vertical-navigation-example-theme-tailwind"}
-
-### Pagination
-
-:component-example{component="pagination-example-theme-rounded"}
-
-## RTL Support
-
-Here are some examples of how components look like in RTL mode.
-
-### Pagination
-
-:component-example{component="pagination-example-r-t-l" hiddenCode}
-
-::callout{icon="i-simple-icons-github" to="https://github.com/nuxt/ui/blob/dev/docs/components/content/examples/PaginationExampleRTL.vue" target="_blank"}
-Take a look at the component!
-::
diff --git a/docs/content/1.getting-started/6.contributing.md b/docs/content/1.getting-started/6.contributing.md
index 62e27542..ac5a6fcc 100644
--- a/docs/content/1.getting-started/6.contributing.md
+++ b/docs/content/1.getting-started/6.contributing.md
@@ -1,10 +1,9 @@
---
title: Contributing
description: Learn how to contribute to Nuxt UI.
+navigation: false
---
-## Overview
-
Nuxt UI thrives thanks to its fantastic community ❤️, which contributes by submitting issues, creating pull requests, and offering valuable feedback.
Before reporting a bug or reporting a feature, please make sure that you have read through our documentation and existing [issues](https://github.com/nuxt/ui/issues).
diff --git a/docs/content/2.elements/1.accordion.md b/docs/content/2.components/accordion.md
similarity index 94%
rename from docs/content/2.elements/1.accordion.md
rename to docs/content/2.components/accordion.md
index 5c6cd08e..7f3a0229 100644
--- a/docs/content/2.elements/1.accordion.md
+++ b/docs/content/2.components/accordion.md
@@ -11,7 +11,7 @@ links:
## Usage
-Pass an array to the `items` prop of the Accordion component. Each item can have any property from the [Button](/elements/button) component such as `label`, `icon`, `color`, `variant`, `size`, etc. but also:
+Pass an array to the `items` prop of the Accordion component. Each item can have any property from the [Button](/components/button) component such as `label`, `icon`, `color`, `variant`, `size`, etc. but also:
- `slot` - A key to customize the item with a slot.
- `content` - The content to display in the panel by default.
@@ -23,7 +23,7 @@ Pass an array to the `items` prop of the Accordion component. Each item can have
### Style
-You can also pass any prop from the [Button](/elements/button) component directly to the Accordion component to style the buttons.
+You can also pass any prop from the [Button](/components/button) component directly to the Accordion component to style the buttons.
::component-card
---
diff --git a/docs/content/2.elements/2.alert.md b/docs/content/2.components/alert.md
similarity index 87%
rename from docs/content/2.elements/2.alert.md
rename to docs/content/2.components/alert.md
index 48f834f8..0d74544c 100644
--- a/docs/content/2.elements/2.alert.md
+++ b/docs/content/2.components/alert.md
@@ -48,7 +48,7 @@ excludedProps:
### Avatar
-Use the [avatar](/elements/avatar) prop as an `object` and configure it with any of its props.
+Use the [avatar](/components/avatar) prop as an `object` and configure it with any of its props.
::component-card
---
@@ -93,7 +93,7 @@ excludedProps:
Use the `close-button` prop to hide or customize the close button on the Alert.
-You can pass all the props of the [Button](/elements/button) component to customize it through the `close-button` prop or globally through `ui.alert.default.closeButton`.
+You can pass all the props of the [Button](/components/button) component to customize it through the `close-button` prop or globally through `ui.alert.default.closeButton`.
It defaults to `null` which means no close button will be displayed. A `close` event will be emitted when the close button is clicked.
@@ -116,7 +116,7 @@ excludedProps:
Use the `actions` prop to add actions to the Alert.
-Like for `closeButton`, you can pass all the props of the [Button](/elements/button) component plus a `click` function in the action but also customize the default style for the actions globally through `ui.alert.default.actionButton`.
+Like for `closeButton`, you can pass all the props of the [Button](/components/button) component plus a `click` function in the action but also customize the default style for the actions globally through `ui.alert.default.actionButton`.
::component-card
---
diff --git a/docs/content/2.elements/3.avatar.md b/docs/content/2.components/avatar.md
similarity index 100%
rename from docs/content/2.elements/3.avatar.md
rename to docs/content/2.components/avatar.md
diff --git a/docs/content/2.elements/4.badge.md b/docs/content/2.components/badge.md
similarity index 100%
rename from docs/content/2.elements/4.badge.md
rename to docs/content/2.components/badge.md
diff --git a/docs/content/5.navigation/5.breadcrumb.md b/docs/content/2.components/breadcrumb.md
similarity index 100%
rename from docs/content/5.navigation/5.breadcrumb.md
rename to docs/content/2.components/breadcrumb.md
diff --git a/docs/content/2.elements/5.button.md b/docs/content/2.components/button.md
similarity index 98%
rename from docs/content/2.elements/5.button.md
rename to docs/content/2.components/button.md
index fa593b70..fb8b8b13 100644
--- a/docs/content/2.elements/5.button.md
+++ b/docs/content/2.components/button.md
@@ -310,7 +310,7 @@ code: |
:u-button{icon="i-heroicons-chevron-down-20-solid" color="gray"}
::
-This can also work with an [Input](/forms/input) component for example:
+This can also work with an [Input](/components/input) component for example:
::component-card{slug="UButtonGroup"}
---
diff --git a/docs/content/7.layout/1.card.md b/docs/content/2.components/card.md
similarity index 100%
rename from docs/content/7.layout/1.card.md
rename to docs/content/2.components/card.md
diff --git a/docs/content/2.elements/13.carousel.md b/docs/content/2.components/carousel.md
similarity index 100%
rename from docs/content/2.elements/13.carousel.md
rename to docs/content/2.components/carousel.md
diff --git a/docs/content/3.forms/5.checkbox.md b/docs/content/2.components/checkbox.md
similarity index 100%
rename from docs/content/3.forms/5.checkbox.md
rename to docs/content/2.components/checkbox.md
diff --git a/docs/content/2.elements/12.chip.md b/docs/content/2.components/chip.md
similarity index 100%
rename from docs/content/2.elements/12.chip.md
rename to docs/content/2.components/chip.md
diff --git a/docs/content/5.navigation/2.command-palette.md b/docs/content/2.components/command-palette.md
similarity index 86%
rename from docs/content/5.navigation/2.command-palette.md
rename to docs/content/2.components/command-palette.md
index 9d9265ee..5ed0cb49 100644
--- a/docs/content/5.navigation/2.command-palette.md
+++ b/docs/content/2.components/command-palette.md
@@ -96,7 +96,7 @@ excludedProps:
Use the `close-button` prop to display a close button on the right side of the input.
-You can pass all the props of the [Button](/elements/button) component to customize it through the `close-button` prop or globally through `ui.commandPalette.default.closeButton`.
+You can pass all the props of the [Button](/components/button) component to customize it through the `close-button` prop or globally through `ui.commandPalette.default.closeButton`.
::component-card
---
@@ -257,3 +257,39 @@ When accessing the component via a template ref, you can use the following:
## Config
:component-preset
+
+## Example
+
+Here are a few examples illustrating how you can customize the appearance of the `CommandPalette` component by utilizing its `ui` prop.
+
+### Algolia
+
+::component-example
+---
+padding: false
+component: 'command-palette-example-theme-algolia'
+componentProps:
+ class: 'max-h-[480px] rounded-md'
+hiddenCode: true
+---
+::
+
+::callout{icon="i-simple-icons-github" to="https://github.com/nuxt/ui/blob/dev/docs/components/content/examples/CommandPaletteExampleThemeAlgolia.vue#L23" target="_blank"}
+Take a look at the component!
+::
+
+### Raycast
+
+::component-example
+---
+padding: false
+component: 'command-palette-example-theme-raycast'
+componentProps:
+ class: 'max-h-[480px] rounded-md'
+hiddenCode: true
+---
+::
+
+::callout{icon="i-simple-icons-github" to="https://github.com/nuxt/ui/blob/dev/docs/components/content/examples/CommandPaletteExampleThemeRaycast.vue#L30" target="_blank"}
+Take a look at the component!
+::
diff --git a/docs/content/7.layout/2.container.md b/docs/content/2.components/container.md
similarity index 100%
rename from docs/content/7.layout/2.container.md
rename to docs/content/2.components/container.md
diff --git a/docs/content/6.overlays/5.context-menu.md b/docs/content/2.components/context-menu.md
similarity index 100%
rename from docs/content/6.overlays/5.context-menu.md
rename to docs/content/2.components/context-menu.md
diff --git a/docs/content/2.components/date-picker.md b/docs/content/2.components/date-picker.md
new file mode 100644
index 00000000..1ae6b7de
--- /dev/null
+++ b/docs/content/2.components/date-picker.md
@@ -0,0 +1,112 @@
+---
+title: DatePicker
+description: 'An example of a date picker component built with v-calendar.'
+---
+
+## Installation
+
+This example is a composition of a [Popover](/components/popover) and [v-calendar](https://github.com/nathanreyes/v-calendar). We also use [date-fns](https://date-fns.org/) to format dates.
+
+::callout{icon="i-heroicons-light-bulb"}
+Note that you can use any calendar library you want.
+::
+
+Let's start by installing the `v-calendar` and `date-fns` dependency:
+
+::code-group
+
+```bash [pnpm]
+pnpm add v-calendar
+```
+
+```bash [yarn]
+yarn add v-calendar
+```
+
+```bash [npm]
+npm install v-calendar
+```
+
+::
+
+## Usage
+
+You can create a `DatePicker.vue` component based on the `DatePicker` from `v-calendar`.
+
+The following example is styled based on the `primary` and `gray` colors and supports the `dark` mode. It also supports a `v-model` or `v-model.range` depending on the type of date you want to use.
+
+```vue [components/DatePicker.vue]
+
+
+
+
+
+
+
+
+```
+
+## Examples
+
+### DatePicker
+
+:component-example{component="date-picker-example"}
+
+### DateRangePicker
+
+:component-example{component="date-picker-range-example"}
diff --git a/docs/content/7.layout/4.divider.md b/docs/content/2.components/divider.md
similarity index 94%
rename from docs/content/7.layout/4.divider.md
rename to docs/content/2.components/divider.md
index 82661a9b..c89bb4bb 100644
--- a/docs/content/7.layout/4.divider.md
+++ b/docs/content/2.components/divider.md
@@ -34,7 +34,7 @@ excludedProps:
### Avatar
-Use the [avatar](/elements/avatar) prop as an `object` and configure it with any of its props.
+Use the [avatar](/components/avatar) prop as an `object` and configure it with any of its props.
::component-card
---
diff --git a/docs/content/2.elements/6.dropdown.md b/docs/content/2.components/dropdown.md
similarity index 97%
rename from docs/content/2.elements/6.dropdown.md
rename to docs/content/2.components/dropdown.md
index a7c218aa..fd4f6b6f 100644
--- a/docs/content/2.elements/6.dropdown.md
+++ b/docs/content/2.components/dropdown.md
@@ -17,7 +17,7 @@ Pass an array of arrays to the `items` prop of the Dropdown component. Each arra
- `labelClass` - The class of the item label.
- `icon` - The icon of the item.
- `iconClass` - The class of the item icon.
-- `avatar` - The avatar of the item. You can pass all the props of the [Avatar](/elements/avatar) component.
+- `avatar` - The avatar of the item. You can pass all the props of the [Avatar](/components/avatar) component.
- `shortcuts` - The shortcuts of the item.
- `slot` - The slot of the item.
- `disabled` - Whether the item is disabled.
diff --git a/docs/content/3.forms/9.form-group.md b/docs/content/2.components/form-group.md
similarity index 94%
rename from docs/content/3.forms/9.form-group.md
rename to docs/content/2.components/form-group.md
index 605b22e7..02bcbca3 100644
--- a/docs/content/3.forms/9.form-group.md
+++ b/docs/content/2.components/form-group.md
@@ -10,7 +10,7 @@ links:
## Usage
-Use the FormGroup component around an [Input](/forms/input), [Textarea](/forms/textarea), [Select](/forms/select) or a [SelectMenu](/forms/select-menu) with a `label`. The `