refactor(module)!: implement design system with CSS variables (#2298)

This commit is contained in:
Benjamin Canac
2024-10-07 14:48:02 +02:00
committed by GitHub
parent 3cf5535b2f
commit 9368c6a639
279 changed files with 6533 additions and 6994 deletions

View File

@@ -39,9 +39,7 @@ export default defineNuxtConfig({
})
```
3. Import Tailwind and Nuxt UI in your `app.vue`{lang="ts-type"} or in your [CSS](https://nuxt.com/docs/getting-started/styling#the-css-property):
::code-group
3. Import Tailwind CSS and Nuxt UI in your `app.vue`{lang="ts-type"} or [CSS](https://nuxt.com/docs/getting-started/styling#the-css-property):
```vue [app.vue]
<style>
@@ -50,13 +48,6 @@ export default defineNuxtConfig({
</style>
```
```css [main.css]
@import "tailwindcss";
@import "@nuxt/ui";
```
::
## Options
You can customize Nuxt UI by providing options in your `nuxt.config.ts`:
@@ -91,25 +82,40 @@ export default defineNuxtConfig({
})
```
### `colorMode`
Use the `colorMode` option to enable or disable the `@nuxt/color-mode` module.
- Default: `true`{lang="ts-type"}
```ts [nuxt.config.ts]
export default defineNuxtConfig({
modules: ['@nuxt/ui'],
ui: {
colorMode: false
}
})
```
### `theme.colors`
Use the `theme.colors` option to choose which Tailwind CSS colors are used to generate classes for components.
- Default: `['red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose']`{lang="ts-type" class="inline"}
- Default: `['primary', 'secondary', 'success', 'info', 'warning', 'error']`{lang="ts-type" class="inline"}
```ts [nuxt.config.ts]
export default defineNuxtConfig({
modules: ['@nuxt/ui'],
ui: {
theme: {
colors: ['blue', 'green', 'red']
colors: ['primary', 'error']
}
}
})
```
::note{to="/getting-started/colors#build-colors"}
This can help reduce the number of CSS classes generated in your bundle.
::tip{to="/getting-started/theme#colors"}
You can use this option to remove some colors and reduce your CSS bundle or add new dynamic colors.
::
### `theme.transitions`

View File

@@ -1,6 +1,6 @@
---
title: Theme
description: 'Learn to customize Nuxt UI components using Tailwind CSS v4 and the Tailwind Variants API.'
description: 'Learn how to customize Nuxt UI components using Tailwind CSS v4, CSS variables and the Tailwind Variants API for powerful and flexible theming.'
---
## Tailwind CSS
@@ -11,7 +11,8 @@ Nuxt UI v3 uses Tailwind CSS v4 alpha which doesn't have a documentation yet, le
Tailwind CSS v4 takes a CSS-first configuration approach, you now customize your theme with CSS variables inside a `@theme` directive:
```css [main.css]
```vue [app.vue]
<style>
@import "tailwindcss";
@import "@nuxt/ui";
@@ -32,6 +33,7 @@ Tailwind CSS v4 takes a CSS-first configuration approach, you now customize your
--color-green-900: #0A5331;
--color-green-950: #052E16;
}
</style>
```
The `@theme` directive tells Tailwind to make new utilities and variants available based on those variables. It's the equivalent of the `theme.extend` key in Tailwind CSS v3 `tailwind.config.ts` file.
@@ -40,19 +42,19 @@ The `@theme` directive tells Tailwind to make new utilities and variants availab
You can learn more about this on [https://tailwindcss.com/blog/tailwindcss-v4-alpha](https://tailwindcss.com/blog/tailwindcss-v4-alpha#css-first-configuration).
::
This is exactly what the [`@import "@nuxt/ui";`](https://github.com/nuxt/ui/blob/v3/src/runtime/index.css) is all about, it extends the default Tailwind CSS theme and declares the `primary`, `error` and `gray` colors to be configurable through the [App Config](https://nuxt.com/docs/guide/directory-structure/app-config#app-config-file) but we'll talk more about that in the [Colors](/getting-started/colors) section.
### `@source`
You can use the `@source` directive to add explicit content glob patterns if you want to look for Tailwind classes in other files that are not automatically detected.
This can be useful when writing Tailwind classes in markdown files with `@nuxt/content`:
```css [main.css]
```vue [app.vue]
<style>
@import "tailwindcss";
@import "@nuxt/ui";
@source "../content/**/*.md";
</style>
```
::note{to="https://github.com/tailwindlabs/tailwindcss/pull/14078"}
@@ -63,18 +65,264 @@ You can learn more about the `@source` directive in this pull request.
You can use the `@plugin` directive to import Tailwind CSS plugins.
```css [main.css]
```vue [app.vue]
<style>
@import "tailwindcss";
@import "@nuxt/ui";
@plugin "@tailwindcss/typography";
</style>
```
::note{to="https://github.com/tailwindlabs/tailwindcss/pull/14264"}
You can learn more about the `@plugin` directive in this pull request.
::
## Tailwind Variants API
## Design system
Nuxt UI extends Tailwind CSS's theming capabilities, providing a flexible design system with pre-configured color aliases and CSS variables. This allows for easy customization and quick adaptation of the UI to your brand's aesthetic.
### Colors
Nuxt UI leverages Nuxt [App Config](https://nuxt.com/docs/guide/directory-structure/app-config#app-config-file) to provide customizable color aliases based on [Tailwind CSS colors](https://tailwindcss.com/docs/customizing-colors#color-palette-reference):
| Color | Default | Description |
| --- | --- | --- |
| `primary`{color="primary"} | `green` | Main brand color, used as the default color for components. |
| `secondary`{color="secondary"} | `blue` | Secondary color to complement the primary color. |
| `success`{color="success"} | `green` | Used for success states. |
| `info`{color="info"} | `blue` | Used for informational states. |
| `warning`{color="warning"} | `yellow` | Used for warning states. |
| `error`{color="error"} | `red` | Used for form error validation states. |
| `neutral` | `slate` | Neutral color for backgrounds, text, etc. |
You can configure these color aliases at runtime in your `app.config.ts` file under the `ui.colors` key, allowing for dynamic theme customization without requiring an application rebuild:
```ts [app.config.ts]
export default defineAppConfig({
ui: {
colors: {
primary: 'blue',
neutral: 'zinc'
}
}
})
```
::note
Try the :prose-icon{name="i-heroicons-swatch-20-solid" class="text-[--ui-primary]"} picker in the header above to change `primary` and `neutral` colors.
::
These colors are used to style the components but also to generate the `color` variants:
::component-code{slug="button"}
---
props:
color: primary
slots:
default: Button
---
::
::tip
You can add you own dynamic color aliases in your `app.config.ts`, you just have to make sure to define them in the [`ui.theme.colors`](/getting-started/installation#themecolors) option in your `nuxt.config.ts` file.
```ts [app.config.ts]
export default defineAppConfig({
ui: {
colors: {
tertiary: 'indigo'
}
}
})
```
```ts [nuxt.config.ts]
export default defineNuxtConfig({
ui: {
theme: {
colors: ['primary', 'secondary', 'tertiary', 'info', 'success', 'warning', 'error']
}
}
})
```
::
::note
These color aliases are not automatically defined as Tailwind CSS colors, so classes like `text-primary-500 dark:text-primary-400` won't be available by default as in Nuxt UI v2. This approach provides more flexibility and prevents overwriting of user-defined Tailwind CSS colors.<br><br>
However, you can generate these classes using Tailwind's `@theme` directive, allowing you to use custom color utility classes while maintaining dynamic color aliases:
```vue [app.vue]
<style>
@import "tailwindcss";
@import "@nuxt/ui";
@theme {
--color-primary-50: var(--ui-color-primary-50);
--color-primary-100: var(--ui-color-primary-100);
--color-primary-200: var(--ui-color-primary-200);
--color-primary-300: var(--ui-color-primary-300);
--color-primary-400: var(--ui-color-primary-400);
--color-primary-500: var(--ui-color-primary-500);
--color-primary-600: var(--ui-color-primary-600);
--color-primary-700: var(--ui-color-primary-700);
--color-primary-800: var(--ui-color-primary-800);
--color-primary-900: var(--ui-color-primary-900);
--color-primary-950: var(--ui-color-primary-950);
}
</style>
```
::
### Tokens
Nuxt UI generates CSS variables as design tokens for component styling. These tokens enable consistent theming and support both light and dark modes. You can use them in Tailwind classes like `text-[--ui-primary]`, which automatically adapts to the current color scheme.
::code-group
```css [Light]
:root {
--ui-primary: var(--ui-color-primary-500);
--ui-secondary: var(--ui-color-secondary-500);
--ui-success: var(--ui-color-success-500);
--ui-info: var(--ui-color-info-500);
--ui-warning: var(--ui-color-warning-500);
--ui-error: var(--ui-color-error-500);
}
```
```css [Dark]
.dark {
--ui-primary: var(--ui-color-primary-400);
--ui-secondary: var(--ui-color-secondary-400);
--ui-success: var(--ui-color-success-400);
--ui-info: var(--ui-color-info-400);
--ui-warning: var(--ui-color-warning-400);
--ui-error: var(--ui-color-error-400);
}
```
::
::tip
You can change which shade is used for each color on light and dark mode:
```vue [app.vue]
<style>
@import "tailwindcss";
@import "@nuxt/ui";
:root {
--ui-primary: var(--ui-color-primary-700);
}
.dark {
--ui-primary: var(--ui-color-primary-200);
}
</style>
```
::
Nuxt UI provides a comprehensive set of design tokens for the `neutral` color palette, ensuring consistent and accessible UI styling across both light and dark modes. These tokens offer fine-grained control over text, background, and border colors:
::code-group
```css [Light]
:root {
/* Least prominent text */
--ui-text-dimmed: var(--ui-color-neutral-400);
/* Slightly muted text */
--ui-text-muted: var(--ui-color-neutral-500);
/* Moderately prominent text */
--ui-text-toned: var(--ui-color-neutral-600);
/* Default text color */
--ui-text: var(--ui-color-neutral-700);
/* Most prominent text */
--ui-text-highlighted: var(--ui-color-neutral-900);
/* Main background color */
--ui-bg: var(--color-white);
/* Slightly elevated background */
--ui-bg-elevated: var(--ui-color-neutral-100);
/* More prominent background */
--ui-bg-accented: var(--ui-color-neutral-200);
/* Inverted background color */
--ui-bg-inverted: var(--ui-color-neutral-900);
/* Default border color */
--ui-border: var(--ui-color-neutral-200);
/* More prominent border */
--ui-border-accented: var(--ui-color-neutral-300);
/* Inverted border color */
--ui-border-inverted: var(--ui-color-neutral-900);
}
```
```css [Dark]
.dark {
/* Least prominent text */
--ui-text-dimmed: var(--ui-color-neutral-500);
/* Slightly muted text */
--ui-text-muted: var(--ui-color-neutral-400);
/* Moderately prominent text */
--ui-text-toned: var(--ui-color-neutral-300);
/* Default text color */
--ui-text: var(--ui-color-neutral-200);
/* Most prominent text */
--ui-text-highlighted: var(--color-white);
/* Main background color */
--ui-bg: var(--ui-color-neutral-900);
/* Slightly elevated background */
--ui-bg-elevated: var(--ui-color-neutral-800);
/* More prominent background */
--ui-bg-accented: var(--ui-color-neutral-700);
/* Inverted background color */
--ui-bg-inverted: var(--color-white);
/* Default border color */
--ui-border: var(--ui-color-neutral-800);
/* More prominent border */
--ui-border-accented: var(--ui-color-neutral-700);
/* Inverted border color */
--ui-border-inverted: var(--color-white);
}
```
::
You can easily customize these CSS variables in your `app.vue`{lang="ts-type"} or [CSS](https://nuxt.com/docs/getting-started/styling#the-css-property) to tailor the appearance of your application:
```vue [app.vue]
<style>
@import "tailwindcss";
@import "@nuxt/ui";
:root {
--ui-bg: var(--ui-color-neutral-50);
--ui-text: var(--ui-color-neutral-900);
}
.dark {
--ui-bg: var(--ui-color-neutral-950);
--ui-border: var(--ui-color-neutral-900);
}
</style>
```
::note
Nuxt UI automatically applies a text and background color on the `<body>` element of your app:
```css
body {
@apply antialiased font-sans text-[--ui-text] bg-[--ui-bg];
}
```
::
## Components theme
Nuxt UI components are styled using the [Tailwind Variants](https://www.tailwind-variants.org/) API, which provides a powerful way to create variants and manage component styles. Let's explore the key features of this API:
@@ -87,7 +335,7 @@ Components in Nuxt UI can have multiple `slots`, each representing a distinct HT
```ts [src/theme/card.ts]
export default {
slots: {
root: 'bg-white dark:bg-gray-900 ring ring-gray-200 dark:ring-gray-800 divide-y divide-gray-200 dark:divide-gray-800 rounded-lg shadow',
root: 'bg-[--ui-bg] ring ring-[--ui-border] divide-y divide-[--ui-border] rounded-lg shadow',
header: 'p-4 sm:px-6',
body: 'p-4 sm:p-6',
footer: 'p-4 sm:px-6'
@@ -135,7 +383,7 @@ export default {
::
::caution
::note
Components without slots don't have a [`ui` prop](#ui-prop), only the [`class` prop](#class-prop) is available to override styles.
::
@@ -146,18 +394,18 @@ Nuxt UI components use `variants` to change the `slots` styles based on props. H
```ts [src/theme/avatar.ts]
export default {
slots: {
root: 'inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-gray-100 dark:bg-gray-800',
root: 'inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-[--ui-bg-elevated]',
image: 'h-full w-full rounded-[inherit] object-cover'
},
variants: {
size: {
'sm': {
sm: {
root: 'size-7 text-sm'
},
'md': {
md: {
root: 'size-8 text-base'
},
'lg': {
lg: {
root: 'size-9 text-lg'
}
}
@@ -182,7 +430,7 @@ props:
The `defaultVariants` property specifies the default values for each variant. It determines how a component looks and behaves when no prop is provided. These default values can be customized in your [`app.config.ts`](#appconfigts) to adjust the standard appearance of components throughout your application.
## Customize components
## Customize theme
You have multiple ways to customize the appearance of Nuxt UI components, you can do it for all components at once or on a per-component basis.
@@ -225,18 +473,18 @@ You can also override a component's **slots** using the `ui` prop. This has prio
---
prettier: true
ignore:
- ui.leadingIcon
- ui.trailingIcon
- color
- variant
- size
- icon
props:
icon: i-heroicons-magnifying-glass
trailingIcon: i-heroicons-chevron-right
size: md
color: gray
color: neutral
variant: outline
ui:
leadingIcon: 'text-primary-500 dark:text-primary-400 size-3'
trailingIcon: 'rotate-90 size-3'
slots:
default: |
@@ -244,7 +492,7 @@ slots:
---
::
In this example, the `leadingIcon` slot is overwritten even though the `md` size variant would apply a `size-5` class by default.
In this example, the `trailingIcon` slot is overwritten with `size-3` even though the `md` size variant would apply a `size-5` class to it.
### `class` prop

View File

@@ -1,168 +0,0 @@
---
title: Colors
description: 'Learn to customize Nuxt UI component colors, enhancing your application visual theme.'
---
## Build colors
Nuxt UI components provide dynamic `color` variants. By default, these variants classes are generated based on the default Tailwind CSS colors. Let's take the [Button](/components/button) component as an example:
::component-code{slug="button"}
---
props:
color: 'green'
slots:
default: Button
---
::
You can change these colors with the [`theme.colors`](/getting-started/installation#themecolors) option in your `nuxt.config.ts` to select only the colors you're actually using.
For example, if you added a custom `cerise` color and only use the default `blue` and `green` colors in your application, you can configure the `colors` option like this:
::code-group
```ts [nuxt.config.ts]
export default defineNuxtConfig({
modules: ['@nuxt/ui'],
ui: {
theme: {
colors: ['cerise', 'blue', 'green']
}
}
})
```
```css [main.css]
@import "tailwindcss";
@import "@nuxt/ui";
@theme {
--color-cerise-50: #FEF2F4;
--color-cerise-100: #FDE6E9;
--color-cerise-200: #FBD0D9;
--color-cerise-300: #F7AAB9;
--color-cerise-400: #F27A93;
--color-cerise-500: #E63F66;
--color-cerise-600: #D42A5B;
--color-cerise-700: #B21E4B;
--color-cerise-800: #951C45;
--color-cerise-900: #801B40;
--color-cerise-950: #470A1F;
}
```
::
::caution
Make sure to use color ranges from `50` to `950`. You can use tools like [UI Colors](https://uicolors.app/) to generate your palette.
::
This configuration will ensure that only classes for those three colors are generated in your final CSS bundle. When you use the `color` prop, it will be typed and provide autocompletion in your editor with those three colors.
```vue
<template>
<UButton color="cerise">Button</UButton>
</template>
```
## Runtime colors
### Default aliases
Nuxt UI introduces three key color aliases used to style components:
- `primary`: Main brand color, used as the default color for components.
- Default: `green`{color="green"}
- `error`: For form error validation states.
- Default: `red`{color="red"}
- `gray`: Neutral color for backgrounds, text, etc.
- Default: `slate`
- `slate | cool | zinc | neutral | stone`
::warning{to="https://tailwindcss.com/docs/customizing-colors#default-color-palette" target="_blank"}
The Tailwind CSS `gray` color is renamed to `cool` in Nuxt UI to avoid conflicts with the `gray` alias.
::
You can configure these aliases in your `app.config.ts` file under the `ui.colors` key:
```ts [app.config.ts]
export default defineAppConfig({
ui: {
colors: {
primary: 'blue',
error: 'orange',
gray: 'zinc'
}
}
})
```
This powerful feature leverages Nuxt [App Config](https://nuxt.com/docs/guide/directory-structure/app-config#app-config-file), enabling dynamic styling of all components at runtime. It allows for real-time theme customization without requiring an application rebuild.
::tip
We recommend using these colors in your application whenever possible with classes like `text-primary-500 dark:text-primary-400`, `border-gray-200 dark:border-gray-800` or `bg-white dark:bg-gray-900` for example.
::
::important
These alias colors don't need to be explicitly listed in the `colors` option of your `nuxt.config.ts`. Also, if you've set `primary` to a custom color (e.g., `cerise`), you don't need to list `cerise` in the `colors` array.
::
::note
You can try this out by using the :prose-icon{name="i-heroicons-swatch-20-solid" class="text-primary-500 dark:text-primary-400"} menu in the header of this documentation.
::
### Custom aliases
You can also add your own color aliases to be configurable at runtime in your `app.config.ts` file:
1. Define the alias color by using CSS variables to let Tailwind know about it:
```css [main.css]
@import "tailwindcss";
@import "@nuxt/ui";
@theme {
--color-secondary-50: var(--color-secondary-50);
--color-secondary-100: var(--color-secondary-100);
--color-secondary-200: var(--color-secondary-200);
--color-secondary-300: var(--color-secondary-300);
--color-secondary-400: var(--color-secondary-400);
--color-secondary-500: var(--color-secondary-500);
--color-secondary-600: var(--color-secondary-600);
--color-secondary-700: var(--color-secondary-700);
--color-secondary-800: var(--color-secondary-800);
--color-secondary-900: var(--color-secondary-900);
--color-secondary-950: var(--color-secondary-950);
}
```
2. Set a default value for the color alias in your `app.config.ts` file:
```ts [app.config.ts]
export default defineAppConfig({
ui: {
colors: {
secondary: 'indigo'
}
}
})
```
3. Add this color to the `colors` option of your `nuxt.config.ts` file to generate classes:
```ts [nuxt.config.ts]
export default defineNuxtConfig({
modules: ['@nuxt/ui'],
ui: {
colors: ['secondary']
}
})
```
4. You can use the `secondary` color alias in your application and use classes like `text-secondary-500 dark:text-secondary-400`:
```vue
<template>
<UButton color="secondary">Button</UButton>
</template>
```

View File

@@ -12,8 +12,6 @@ links:
Nuxt UI automatically registers the `@nuxt/fonts` module for you, so there's no additional setup required. To use a font in your Nuxt UI application, you can simply declare it in your CSS:
::code-group
```vue [app.vue]
<style>
@import "tailwindcss";
@@ -25,17 +23,6 @@ Nuxt UI automatically registers the `@nuxt/fonts` module for you, so there's no
</style>
```
```css [main.css]
@import "tailwindcss";
@import "@nuxt/ui";
@theme {
--font-family-sans: 'Public Sans', sans-serif;
}
```
::
That's it! Nuxt Fonts will detect this and you should immediately see the web font loaded in your browser.
::tip{to="https://fonts.nuxt.com/advanced" target="_blank"}

View File

@@ -42,7 +42,7 @@ function showToast() {
toast.add({
title: 'Success',
description: 'Your action was completed successfully.',
color: 'green'
color: 'success'
})
}
</script>

View File

@@ -39,7 +39,7 @@ props:
content: 'You have nothing to do, @nuxt/icon will handle it automatically.'
- label: 'Colors'
icon: 'i-heroicons-swatch'
content: 'Choose a primary and a gray color from your Tailwind CSS theme.'
content: 'Choose a primary and a neutral color from your Tailwind CSS theme.'
- label: 'Components'
icon: 'i-heroicons-cube-transparent'
content: 'You can customize components by using the `class` / `ui` props or in your app.config.ts.'
@@ -68,7 +68,7 @@ props:
content: 'You have nothing to do, @nuxt/icon will handle it automatically.'
- label: 'Colors'
icon: 'i-heroicons-swatch'
content: 'Choose a primary and a gray color from your Tailwind CSS theme.'
content: 'Choose a primary and a neutral color from your Tailwind CSS theme.'
- label: 'Components'
icon: 'i-heroicons-cube-transparent'
content: 'You can customize components by using the `class` / `ui` props or in your app.config.ts.'
@@ -97,7 +97,7 @@ props:
content: 'You have nothing to do, @nuxt/icon will handle it automatically.'
- label: 'Colors'
icon: 'i-heroicons-swatch'
content: 'Choose a primary and a gray color from your Tailwind CSS theme.'
content: 'Choose a primary and a neutral color from your Tailwind CSS theme.'
- label: 'Components'
icon: 'i-heroicons-cube-transparent'
content: 'You can customize components by using the `class` / `ui` props or in your app.config.ts.'
@@ -127,7 +127,7 @@ props:
content: 'You have nothing to do, @nuxt/icon will handle it automatically.'
- label: 'Colors'
icon: 'i-heroicons-swatch'
content: 'Choose a primary and a gray color from your Tailwind CSS theme.'
content: 'Choose a primary and a neutral color from your Tailwind CSS theme.'
disabled: true
- label: 'Components'
icon: 'i-heroicons-cube-transparent'
@@ -139,7 +139,7 @@ props:
Use the `trailing-icon` prop to customize the trailing [Icon](/components/icon) of each item. Defaults to `i-heroicons-chevron-down-20-solid`.
::note
::tip
You can also set an icon for a specific item by using the `trailingIcon` property in the item object.
::
@@ -161,7 +161,7 @@ props:
trailingIcon: 'i-heroicons-plus-20-solid'
- label: 'Colors'
icon: 'i-heroicons-swatch'
content: 'Choose a primary and a gray color from your Tailwind CSS theme.'
content: 'Choose a primary and a neutral color from your Tailwind CSS theme.'
- label: 'Components'
icon: 'i-heroicons-cube-transparent'
content: 'You can customize components by using the `class` / `ui` props or in your app.config.ts.'
@@ -202,7 +202,7 @@ props:
---
::
::note
::tip
The `#body` slot includes some pre-defined styles, use the [`#content` slot](#with-content-slot) if you want to start from scratch.
::

View File

@@ -78,7 +78,7 @@ ignore:
- description
- icon
props:
color: gray
color: neutral
title: 'Heads up!'
description: 'You can change the primary color in your app config.'
icon: 'i-heroicons-command-line'
@@ -97,7 +97,7 @@ ignore:
- description
- icon
props:
color: gray
color: neutral
variant: solid
title: 'Heads up!'
description: 'You can change the primary color in your app config.'
@@ -186,7 +186,7 @@ props:
actions:
- label: Action 1
- label: Action 2
color: gray
color: neutral
variant: subtle
---
::

View File

@@ -35,7 +35,7 @@ Use the `color` prop to change the color of the Badge.
::component-code
---
props:
color: gray
color: neutral
slots:
default: Badge
---
@@ -48,7 +48,7 @@ Use the `variant` props to change the variant of the Badge.
::component-code
---
props:
color: gray
color: neutral
variant: outline
slots:
default: Badge

View File

@@ -17,11 +17,11 @@ prettier: true
slots:
default: |
<UButton color="gray" variant="subtle" label="Button" />
<UButton color="gray" variant="outline" icon="i-heroicons-chevron-down-20-solid" />
<UButton color="neutral" variant="subtle" label="Button" />
<UButton color="neutral" variant="outline" icon="i-heroicons-chevron-down-20-solid" />
---
:u-button{color="gray" variant="subtle" label="Button"}
:u-button{color="gray" variant="outline" icon="i-heroicons-chevron-down-20-solid"}
:u-button{color="neutral" variant="subtle" label="Button"}
:u-button{color="neutral" variant="outline" icon="i-heroicons-chevron-down-20-solid"}
::
### Size
@@ -36,11 +36,11 @@ props:
slots:
default: |
<UButton color="gray" variant="subtle" label="Button" />
<UButton color="gray" variant="outline" icon="i-heroicons-chevron-down-20-solid" />
<UButton color="neutral" variant="subtle" label="Button" />
<UButton color="neutral" variant="outline" icon="i-heroicons-chevron-down-20-solid" />
---
:u-button{color="gray" variant="subtle" label="Button"}
:u-button{color="gray" variant="outline" icon="i-heroicons-chevron-down-20-solid"}
:u-button{color="neutral" variant="subtle" label="Button"}
:u-button{color="neutral" variant="outline" icon="i-heroicons-chevron-down-20-solid"}
::
### Orientation
@@ -55,11 +55,11 @@ props:
slots:
default: |
<UButton color="gray" variant="subtle" label="Submit" />
<UButton color="gray" variant="outline" label="Cancel" />
<UButton color="neutral" variant="subtle" label="Submit" />
<UButton color="neutral" variant="outline" label="Cancel" />
---
:u-button{color="gray" variant="subtle" label="Submit"}
:u-button{color="gray" variant="outline" label="Cancel"}
:u-button{color="neutral" variant="subtle" label="Submit"}
:u-button{color="neutral" variant="outline" label="Cancel"}
::
## Examples
@@ -74,12 +74,12 @@ prettier: true
slots:
default: |
<UInput color="gray" variant="outline" placeholder="Enter token" />
<UInput color="neutral" variant="outline" placeholder="Enter token" />
<UButton color="gray" variant="subtle" icon="i-heroicons-clipboard-document" />
<UButton color="neutral" variant="subtle" icon="i-heroicons-clipboard-document" />
---
:u-input{color="gray" variant="outline" placeholder="Enter token"}
:u-button{color="gray" variant="subtle" icon="i-heroicons-clipboard-document"}
:u-input{color="neutral" variant="outline" placeholder="Enter token"}
:u-button{color="neutral" variant="subtle" icon="i-heroicons-clipboard-document"}
::
### With tooltip

View File

@@ -52,7 +52,7 @@ Use the `color` prop to change the color of the Button.
::component-code
---
props:
color: gray
color: neutral
slots:
default: Button
---
@@ -65,7 +65,7 @@ Use the `variant` prop to change the variant of the Button.
::component-code
---
props:
color: gray
color: neutral
variant: outline
slots:
default: Button
@@ -211,10 +211,10 @@ ignore:
- icon
props:
icon: i-heroicons-rocket-launch
color: gray
color: neutral
variant: outline
ui:
leadingIcon: 'text-primary-500 dark:text-primary-400'
leadingIcon: 'text-[--ui-primary]'
slots:
default: |

View File

@@ -7,7 +7,7 @@ links:
navigation:
badge:
label: Todo
color: gray
color: neutral
disabled: true
---

View File

@@ -129,7 +129,7 @@ ignore:
- label
- defaultValue
props:
color: gray
color: neutral
defaultValue: true
label: Check me
---

View File

@@ -16,9 +16,9 @@ prettier: true
slots:
default: |
<UButton icon="i-heroicons-envelope" color="gray" variant="subtle" />
<UButton icon="i-heroicons-envelope" color="neutral" variant="subtle" />
---
:u-button{icon="i-heroicons-envelope" color="gray" variant="subtle"}
:u-button{icon="i-heroicons-envelope" color="neutral" variant="subtle"}
::
### Color
@@ -29,13 +29,13 @@ Use the `color` prop to change the color of the Chip.
---
prettier: true
props:
color: gray
color: neutral
slots:
default: |
<UButton icon="i-heroicons-envelope" color="gray" variant="subtle" />
<UButton icon="i-heroicons-envelope" color="neutral" variant="subtle" />
---
:u-button{icon="i-heroicons-envelope" color="gray" variant="subtle"}
:u-button{icon="i-heroicons-envelope" color="neutral" variant="subtle"}
::
### Size
@@ -50,9 +50,9 @@ props:
slots:
default: |
<UButton icon="i-heroicons-envelope" color="gray" variant="subtle" />
<UButton icon="i-heroicons-envelope" color="neutral" variant="subtle" />
---
:u-button{icon="i-heroicons-envelope" color="gray" variant="subtle"}
:u-button{icon="i-heroicons-envelope" color="neutral" variant="subtle"}
::
### Text
@@ -68,9 +68,9 @@ props:
slots:
default: |
<UButton icon="i-heroicons-envelope" color="gray" variant="subtle" />
<UButton icon="i-heroicons-envelope" color="neutral" variant="subtle" />
---
:u-button{icon="i-heroicons-envelope" color="gray" variant="subtle"}
:u-button{icon="i-heroicons-envelope" color="neutral" variant="subtle"}
::
### Position
@@ -85,9 +85,9 @@ props:
slots:
default: |
<UButton icon="i-heroicons-envelope" color="gray" variant="subtle" />
<UButton icon="i-heroicons-envelope" color="neutral" variant="subtle" />
---
:u-button{icon="i-heroicons-envelope" color="gray" variant="subtle"}
:u-button{icon="i-heroicons-envelope" color="neutral" variant="subtle"}
::
### Inset

View File

@@ -25,14 +25,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-down-20-solid" block />
<UButton label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-down-20-solid" block />
content: |
<Placeholder class="h-48" />
---
:u-button{label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-down-20-solid" block}
:u-button{label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-down-20-solid" block}
#content
:placeholder{class="h-48"}
@@ -53,14 +53,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-down-20-solid" block />
<UButton label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-down-20-solid" block />
content: |
<Placeholder class="h-48" />
---
:u-button{label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-down-20-solid" block}
:u-button{label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-down-20-solid" block}
#content
:placeholder{class="h-48"}

View File

@@ -355,7 +355,7 @@ class: '!p-0'
---
::
::note
::tip
You can also use the `select` field on each item and/or the `@update:model-value` event.
::

View File

@@ -90,12 +90,12 @@ props:
slots:
default: |
<div class="flex items-center justify-center rounded-md border border-dashed border-gray-300 dark:border-gray-700 text-sm aspect-video w-72">
<div class="flex items-center justify-center rounded-md border border-dashed border-[--ui-border-accented] text-sm aspect-video w-72">
Right click here
</div>
---
:div{class="flex items-center justify-center rounded-md border border-dashed border-gray-300 dark:border-gray-700 text-sm aspect-video w-72"}[Right click here]
:div{class="flex items-center justify-center rounded-md border border-dashed border-[--ui-border-accented] text-sm aspect-video w-72"}[Right click here]
::
::note
@@ -131,12 +131,12 @@ props:
slots:
default: |
<div class="flex items-center justify-center rounded-md border border-dashed border-gray-300 dark:border-gray-700 text-sm aspect-video w-72">
<div class="flex items-center justify-center rounded-md border border-dashed border-[--ui-border-accented] text-sm aspect-video w-72">
Right click here
</div>
---
:div{class="flex items-center justify-center rounded-md border border-dashed border-gray-300 dark:border-gray-700 text-sm aspect-video w-72"}[Right click here]
:div{class="flex items-center justify-center rounded-md border border-dashed border-[--ui-border-accented] text-sm aspect-video w-72"}[Right click here]
::
### Disabled
@@ -164,12 +164,12 @@ props:
slots:
default: |
<div class="flex items-center justify-center rounded-md border border-dashed border-gray-300 dark:border-gray-700 text-sm aspect-video w-72">
<div class="flex items-center justify-center rounded-md border border-dashed border-[--ui-border-accented] text-sm aspect-video w-72">
Right click here
</div>
---
:div{class="flex items-center justify-center rounded-md border border-dashed border-gray-300 dark:border-gray-700 text-sm aspect-video w-72"}[Right click here]
:div{class="flex items-center justify-center rounded-md border border-dashed border-[--ui-border-accented] text-sm aspect-video w-72"}[Right click here]
::
## Examples

View File

@@ -21,14 +21,14 @@ prettier: true
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid" />
<UButton label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid" />
content: |
<Placeholder class="h-48 m-4" />
---
:u-button{label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid"}
:u-button{label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid"}
#content
:placeholder{class="h-48 m-4"}
@@ -48,14 +48,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid" />
<UButton label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid" />
body: |
<Placeholder class="h-48" />
---
:u-button{label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid"}
:u-button{label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid"}
#body
:placeholder{class="h-48"}
@@ -76,14 +76,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid" />
<UButton label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid" />
body: |
<Placeholder class="h-48" />
---
:u-button{label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid"}
:u-button{label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid"}
#body
:placeholder{class="h-48"}
@@ -105,14 +105,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid" />
<UButton label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid" />
content: |
<Placeholder class="h-96 m-4" />
---
:u-button{label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid"}
:u-button{label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid"}
#content
:placeholder{class="h-96 m-4"}
@@ -130,14 +130,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid" />
<UButton label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid" />
content: |
<Placeholder class="w-96 m-4" />
---
:u-button{label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid"}
:u-button{label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid"}
#content
:placeholder{class="w-96 m-4"}
@@ -155,14 +155,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid" />
<UButton label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid" />
content: |
<Placeholder class="h-48 m-4" />
---
:u-button{label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid"}
:u-button{label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid"}
#content
:placeholder{class="h-48 m-4"}
@@ -180,14 +180,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid" />
<UButton label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid" />
content: |
<Placeholder class="h-48 m-4" />
---
:u-button{label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid"}
:u-button{label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid"}
#content
:placeholder{class="h-48 m-4"}
@@ -205,26 +205,26 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid" />
<UButton label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid" />
content: |
<Placeholder class="h-48 m-4" />
---
:u-button{label="Open" color="gray" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid"}
:u-button{label="Open" color="neutral" variant="subtle" trailing-icon="i-heroicons-chevron-up-20-solid"}
#content
:placeholder{class="h-screen m-4"}
::
::important
::warning
Make sure to add the `vaul-drawer-wrapper` directive to a parent element of your app to make this work.
```vue [app.vue]
<template>
<UApp>
<div class="bg-white dark:bg-gray-900" vaul-drawer-wrapper>
<div class="bg-[--ui-bg]" vaul-drawer-wrapper>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
@@ -238,7 +238,7 @@ export default defineNuxtConfig({
app: {
rootAttrs: {
'vaul-drawer-wrapper': '',
'class': 'bg-white dark:bg-gray-900'
'class': 'bg-[--ui-bg]'
}
}
})

View File

@@ -91,10 +91,10 @@ props:
slots:
default: |
<UButton icon="i-heroicons-bars-3" color="gray" variant="outline" />
<UButton icon="i-heroicons-bars-3" color="neutral" variant="outline" />
---
:u-button{icon="i-heroicons-bars-3" color="gray" variant="outline"}
:u-button{icon="i-heroicons-bars-3" color="neutral" variant="outline"}
::
::note
@@ -143,10 +143,10 @@ props:
slots:
default: |
<UButton label="Open" icon="i-heroicons-bars-3" color="gray" variant="outline" />
<UButton label="Open" icon="i-heroicons-bars-3" color="neutral" variant="outline" />
---
:u-button{label="Open" icon="i-heroicons-bars-3" color="gray" variant="outline"}
:u-button{label="Open" icon="i-heroicons-bars-3" color="neutral" variant="outline"}
::
### Arrow
@@ -175,10 +175,10 @@ props:
slots:
default: |
<UButton label="Open" icon="i-heroicons-bars-3" color="gray" variant="outline" />
<UButton label="Open" icon="i-heroicons-bars-3" color="neutral" variant="outline" />
---
:u-button{label="Open" icon="i-heroicons-bars-3" color="gray" variant="outline"}
:u-button{label="Open" icon="i-heroicons-bars-3" color="neutral" variant="outline"}
::
### Size
@@ -209,13 +209,13 @@ props:
slots:
default: |
<UButton size="xl" label="Open" icon="i-heroicons-bars-3" color="gray" variant="outline" />
<UButton size="xl" label="Open" icon="i-heroicons-bars-3" color="neutral" variant="outline" />
---
:u-button{size="xl" label="Open" icon="i-heroicons-bars-3" color="gray" variant="outline"}
:u-button{size="xl" label="Open" icon="i-heroicons-bars-3" color="neutral" variant="outline"}
::
::caution
::warning
The `size` prop will not be proxied to the Button, you need to set it yourself.
::
@@ -248,10 +248,10 @@ props:
slots:
default: |
<UButton label="Open" icon="i-heroicons-bars-3" color="gray" variant="outline" />
<UButton label="Open" icon="i-heroicons-bars-3" color="neutral" variant="outline" />
---
:u-button{label="Open" icon="i-heroicons-bars-3" color="gray" variant="outline"}
:u-button{label="Open" icon="i-heroicons-bars-3" color="neutral" variant="outline"}
::
## Examples

View File

@@ -138,7 +138,7 @@ slots:
:u-input{placeholder="Enter your email" class="w-full"}
::
::tip{to="/getting-started/colors"}
::tip{to="/getting-started/theme#colors"}
This sets the `color` to `error` on the form control. You can change it globally in your `app.config.ts`.
::

View File

@@ -171,10 +171,10 @@ When accessing the component via a template ref, you can use the following:
| Name | Type |
| ---- | ---- |
| `submit()`{lang="ts-type"} | `Promise<void>`{lang="ts-type"} <br> <div class="text-gray-600 dark:text-gray-300 mt-1"><p>Triggers form submission.</p> |
| `validate(path?: string \| string[], opts: { silent?: boolean })`{lang="ts-type"} | `Promise<T>`{lang="ts-type"} <br> <div class="text-gray-600 dark:text-gray-300 mt-1"><p>Triggers form validation. Will raise any errors unless `opts.silent` is set to true.</p> |
| `clear(path?: string)`{lang="ts-type"} | `void` <br> <div class="text-gray-600 dark:text-gray-300 mt-1"><p>Clears form errors associated with a specific path. If no path is provided, clears all form errors.</p> |
| `getErrors(path?: string)`{lang="ts-type"} | `FormError[]`{lang="ts-type"} <br> <div class="text-gray-600 dark:text-gray-300 mt-1"><p>Retrieves form errors associated with a specific path. If no path is provided, returns all form errors.</p></div> |
| `setErrors(errors: FormError[], path?: string)`{lang="ts-type"} | `void` <br> <div class="text-gray-600 dark:text-gray-300 mt-1"><p>Sets form errors for a given path. If no path is provided, overrides all errors.</p> |
| `errors`{lang="ts-type"} | `Ref<FormError[]>`{lang="ts-type"} <br> <div class="text-gray-600 dark:text-gray-300 mt-1"><p>A reference to the array containing validation errors. Use this to access or manipulate the error information.</p> |
| `submit()`{lang="ts-type"} | `Promise<void>`{lang="ts-type"} <br> <div class="text-[--ui-text-toned] mt-1"><p>Triggers form submission.</p> |
| `validate(path?: string \| string[], opts: { silent?: boolean })`{lang="ts-type"} | `Promise<T>`{lang="ts-type"} <br> <div class="text-[--ui-text-toned] mt-1"><p>Triggers form validation. Will raise any errors unless `opts.silent` is set to true.</p> |
| `clear(path?: string)`{lang="ts-type"} | `void` <br> <div class="text-[--ui-text-toned] mt-1"><p>Clears form errors associated with a specific path. If no path is provided, clears all form errors.</p> |
| `getErrors(path?: string)`{lang="ts-type"} | `FormError[]`{lang="ts-type"} <br> <div class="text-[--ui-text-toned] mt-1"><p>Retrieves form errors associated with a specific path. If no path is provided, returns all form errors.</p></div> |
| `setErrors(errors: FormError[], path?: string)`{lang="ts-type"} | `void` <br> <div class="text-[--ui-text-toned] mt-1"><p>Sets form errors for a given path. If no path is provided, overrides all errors.</p> |
| `errors`{lang="ts-type"} | `Ref<FormError[]>`{lang="ts-type"} <br> <div class="text-[--ui-text-toned] mt-1"><p>A reference to the array containing validation errors. Use this to access or manipulate the error information.</p> |
| `disabled`{lang="ts-type"} | `Ref<boolean>`{lang="ts-type"} |

View File

@@ -18,6 +18,6 @@ props:
---
::
::caution
::tip
It's highly recommended to install the icons collections you need, read more about this in [Icons](/getting-started/icons#collections).
::

View File

@@ -266,7 +266,7 @@ external:
- modelValue
props:
modelValue: 'Backlog'
color: gray
color: neutral
highlight: true
items:
- Backlog
@@ -295,7 +295,7 @@ external:
- modelValue
props:
modelValue: 'Backlog'
color: gray
color: neutral
variant: subtle
highlight: false
items:

View File

@@ -65,7 +65,7 @@ Use the `color` prop to change the ring color when the Input is focused.
ignore:
- placeholder
props:
color: gray
color: neutral
highlight: true
placeholder: 'Search...'
---
@@ -84,7 +84,7 @@ Use the `variant` prop to change the variant of the Input.
ignore:
- placeholder
props:
color: gray
color: neutral
variant: subtle
highlight: false
placeholder: 'Search...'

View File

@@ -65,7 +65,7 @@ props:
raw: true
to: /components/link
activeClass: 'font-bold'
inactiveClass: 'text-gray-500 dark:text-gray-500'
inactiveClass: 'text-[--ui-text-muted]'
slots:
default: Link
---

View File

@@ -21,14 +21,14 @@ prettier: true
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
content: |
<Placeholder class="h-48 m-4" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#content
:placeholder{class="h-48 m-4"}
@@ -48,14 +48,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
body: |
<Placeholder class="h-48" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#body
:placeholder{class="h-48"}
@@ -76,14 +76,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
body: |
<Placeholder class="h-48" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#body
:placeholder{class="h-48"}
@@ -111,14 +111,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
body: |
<Placeholder class="h-48" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#body
:placeholder{class="h-48"}
@@ -143,14 +143,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
body: |
<Placeholder class="h-48" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#body
:placeholder{class="h-48"}
@@ -175,14 +175,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
body: |
<Placeholder class="h-48" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#body
:placeholder{class="h-48"}
@@ -203,14 +203,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
body: |
<Placeholder class="h-48" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#body
:placeholder{class="h-48"}
@@ -232,14 +232,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
body: |
<Placeholder class="h-full" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#body
:placeholder{class="h-full"}
@@ -261,14 +261,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
body: |
<Placeholder class="h-48" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#body
:placeholder{class="h-48"}
@@ -298,7 +298,7 @@ This allows you to move the trigger outside of the Modal or remove it entirely.
You can use the [`useModal`](/composables/use-modal) composable to open a Modal programatically.
::important
::warning
Make sure to wrap your app with the [App](/components/app) component which uses the [ModalProvider](https://github.com/nuxt/ui/blob/v3/src/runtime/components/ModalProvider.vue) component.
::

View File

@@ -54,7 +54,7 @@ props:
description: 'You have nothing to do, @nuxt/icon will handle it automatically.'
- label: 'Colors'
icon: 'i-heroicons-swatch'
description: 'Choose a primary and a gray color from your Tailwind CSS theme.'
description: 'Choose a primary and a neutral color from your Tailwind CSS theme.'
- label: 'Theme'
icon: 'i-heroicons-cog'
description: 'You can customize components by using the `class` / `ui` props or in your app.config.ts.'
@@ -203,12 +203,12 @@ props:
badge: 3.8k
to: https://github.com/nuxt/ui
target: _blank
class: 'data-[orientation=horizontal]:border-b data-[orientation=vertical]:border-l border-gray-200 dark:border-gray-800'
class: 'data-[orientation=horizontal]:border-b data-[orientation=vertical]:border-l border-[--ui-border]'
---
::
::note
In this example, the `border-l` and `border-b` classes are applied to display a gray line, this is not done by default to let you have a clean slate to work with.
In this example, the `border-l` and `border-b` classes are applied to display a border, this is not done by default to let you have a clean slate to work with.
::
### Color
@@ -222,7 +222,7 @@ ignore:
external:
- items
props:
color: 'gray'
color: neutral
items:
- - label: Guide
icon: i-heroicons-book-open
@@ -253,8 +253,8 @@ ignore:
external:
- items
props:
color: 'gray'
variant: 'link'
color: neutral
variant: link
highlight: false
items:
- - label: Guide
@@ -283,7 +283,7 @@ The `highlight` prop changes the `pill` variant active item style. Try it out to
Use the `trailing-icon` prop to customize the trailing [Icon](/components/icon) of each item. Defaults to `i-heroicons-chevron-down-20-solid`. This icon is only displayed when an item has children.
::note
::tip
You can also set an icon for a specific item by using the `trailingIcon` property in the item object.
::
@@ -313,7 +313,7 @@ props:
description: 'You have nothing to do, @nuxt/icon will handle it automatically.'
- label: 'Colors'
icon: 'i-heroicons-swatch'
description: 'Choose a primary and a gray color from your Tailwind CSS theme.'
description: 'Choose a primary and a neutral color from your Tailwind CSS theme.'
- label: 'Theme'
icon: 'i-heroicons-cog'
description: 'You can customize components by using the `class` / `ui` props or in your app.config.ts.'
@@ -405,7 +405,7 @@ props:
description: 'You have nothing to do, @nuxt/icon will handle it automatically.'
- label: 'Colors'
icon: 'i-heroicons-swatch'
description: 'Choose a primary and a gray color from your Tailwind CSS theme.'
description: 'Choose a primary and a neutral color from your Tailwind CSS theme.'
- label: 'Theme'
icon: 'i-heroicons-cog'
description: 'You can customize components by using the `class` / `ui` props or in your app.config.ts.'

View File

@@ -116,7 +116,7 @@ props:
### Color
Use the `color` prop to set the color of the inactive controls. Defaults to `gray`.
Use the `color` prop to set the color of the inactive controls. Defaults to `neutral`.
::component-code
---
@@ -130,24 +130,12 @@ model:
items:
color:
- primary
- green
- red
- orange
- amber
- yellow
- lime
- emerald
- teal
- cyan
- sky
- blue
- indigo
- violet
- purple
- fuchsia
- pink
- rose
- gray
- secondary
- success
- info
- warning
- error
- neutral
props:
page: 5
color: primary
@@ -171,24 +159,12 @@ model:
items:
color:
- primary
- green
- red
- orange
- amber
- yellow
- lime
- emerald
- teal
- cyan
- sky
- blue
- indigo
- violet
- purple
- fuchsia
- pink
- rose
- gray
- secondary
- success
- info
- warning
- error
- neutral
variant:
- solid
- outline
@@ -198,7 +174,7 @@ items:
- link
props:
page: 5
color: gray
color: neutral
variant: subtle
total: 100
---
@@ -220,27 +196,15 @@ model:
items:
activeColor:
- primary
- green
- red
- orange
- amber
- yellow
- lime
- emerald
- teal
- cyan
- sky
- blue
- indigo
- violet
- purple
- fuchsia
- pink
- rose
- gray
- secondary
- success
- info
- warning
- error
- neutral
props:
page: 5
activeColor: gray
activeColor: neutral
total: 100
---
::
@@ -261,24 +225,12 @@ model:
items:
activeColor:
- primary
- green
- red
- orange
- amber
- yellow
- lime
- emerald
- teal
- cyan
- sky
- blue
- indigo
- violet
- purple
- fuchsia
- pink
- rose
- gray
- secondary
- success
- info
- warning
- error
- neutral
activeVariant:
- solid
- outline

View File

@@ -21,14 +21,14 @@ prettier: true
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
content: |
<Placeholder class="size-48 m-4 inline-flex" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#content
:placeholder{class="size-48 m-4 inline-flex"}
@@ -50,14 +50,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
content: |
<Placeholder class="size-48 m-4 inline-flex" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#content
:placeholder{class="size-48 m-4 inline-flex"}
@@ -83,14 +83,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
content: |
<Placeholder class="size-48 m-4 inline-flex" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#content
:placeholder{class="size-48 m-4 inline-flex"}
@@ -121,14 +121,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
content: |
<Placeholder class="size-48 m-4 inline-flex" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#content
:placeholder{class="size-48 m-4 inline-flex"}
@@ -148,14 +148,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
content: |
<Placeholder class="size-48 m-4 inline-flex" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#content
:placeholder{class="size-48 m-4 inline-flex"}

View File

@@ -115,7 +115,7 @@ Use the `color` prop to change the color of the Slider.
::component-code
---
props:
color: gray
color: neutral
---
::

View File

@@ -66,7 +66,7 @@ props:
---
::
::note
::caution
When using objects, you need to reference the `value` property of the object in the `v-model` directive or the `default-value` prop.
::
@@ -156,7 +156,7 @@ ignore:
external:
- items
props:
color: 'gray'
color: neutral
defaultValue: 'System'
items:
- 'System'

View File

@@ -74,7 +74,7 @@ props:
---
::
::note
::caution
Unlike the [Select](/components/select) component, the SelectMenu expects the whole object to be passed to the `v-model` directive or the `default-value` prop by default.
::
@@ -274,7 +274,7 @@ external:
- modelValue
props:
modelValue: 'Backlog'
color: gray
color: neutral
highlight: true
items:
- Backlog
@@ -303,7 +303,7 @@ external:
- modelValue
props:
modelValue: 'Backlog'
color: gray
color: neutral
variant: subtle
highlight: false
items:

View File

@@ -68,7 +68,7 @@ props:
---
::
::note
::caution
When using objects, you need to reference the `value` property of the object in the `v-model` directive or the `default-value` prop.
::
@@ -152,7 +152,7 @@ props:
Use the `content` prop to control how the Select content is rendered, like its its `align`, `side` or `position` for example. Defaults to `popper` to match other components.
::caution
::warning
The `content.align`, `content.side`, etc. properties only apply when `content.position` is set to `popper`.
::
@@ -209,7 +209,7 @@ ignore:
external:
- items
props:
color: gray
color: neutral
highlight: true
defaultValue: 'Backlog'
items:
@@ -237,7 +237,7 @@ ignore:
external:
- items
props:
color: gray
color: neutral
variant: subtle
highlight: false
defaultValue: 'Backlog'

View File

@@ -74,13 +74,13 @@ props:
### Color
Use the `color` prop to change the color of the Separator. Defaults to `gray`.
Use the `color` prop to change the color of the Separator. Defaults to `neutral`.
::component-code
---
class: 'p-8'
props:
color: 'primary'
color: primary
type: solid
---
::
@@ -105,7 +105,7 @@ Use the `size` prop to change the size of the Separator. Defaults to `xs`.
---
class: 'p-8'
props:
size: 'lg'
size: lg
---
::

View File

@@ -21,14 +21,14 @@ prettier: true
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
content: |
<Placeholder class="h-full m-4" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#content
:placeholder{class="h-full m-4"}
@@ -48,14 +48,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
body: |
<Placeholder class="h-full" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#body
:placeholder{class="h-full"}
@@ -76,14 +76,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
body: |
<Placeholder class="h-full" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#body
:placeholder{class="h-full"}
@@ -111,14 +111,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
body: |
<Placeholder class="h-full" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#body
:placeholder{class="h-full"}
@@ -143,14 +143,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
body: |
<Placeholder class="h-full" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#body
:placeholder{class="h-full"}
@@ -175,14 +175,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
body: |
<Placeholder class="h-full min-h-48" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#body
:placeholder{class="h-full min-h-48"}
@@ -203,14 +203,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
body: |
<Placeholder class="h-full" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#body
:placeholder{class="h-full"}
@@ -231,14 +231,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
body: |
<Placeholder class="h-full" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#body
:placeholder{class="h-full"}
@@ -260,14 +260,14 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
body: |
<Placeholder class="h-full" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
#body
:placeholder{class="h-full"}
@@ -297,7 +297,7 @@ This allows you to move the trigger outside of the Slideover or remove it entire
You can use the [`useSlideover`](/composables/use-slideover) composable to open a Slideover programatically.
::important
::warning
Make sure to wrap your app with the [App](/components/app) component which uses the [SlideoverProvider](https://github.com/nuxt/ui/blob/v3/src/runtime/components/SlideoverProvider.vue) component.
::

View File

@@ -116,7 +116,7 @@ Use the `color` prop to change the color of the Slider.
ignore:
- defaultValue
props:
color: gray
color: neutral
defaultValue: 50
---
::

View File

@@ -137,7 +137,7 @@ ignore:
- label
- defaultValue
props:
color: gray
color: neutral
defaultValue: true
label: Check me
---

View File

@@ -7,7 +7,7 @@ links:
navigation:
badge:
label: Todo
color: gray
color: neutral
disabled: true
---

View File

@@ -111,7 +111,7 @@ ignore:
external:
- items
props:
color: gray
color: neutral
content: false
items:
- label: Account
@@ -133,7 +133,7 @@ ignore:
external:
- items
props:
color: gray
color: neutral
variant: link
content: false
items:

View File

@@ -41,7 +41,7 @@ Use the `color` prop to change the ring color when the Textarea is focused.
ignore:
- placeholder
props:
color: gray
color: neutral
highlight: true
placeholder: 'Type something...'
---
@@ -60,7 +60,7 @@ Use the `variant` prop to change the variant of the Textarea.
ignore:
- placeholder
props:
color: gray
color: neutral
variant: subtle
highlight: false
placeholder: 'Type something...'

View File

@@ -13,7 +13,7 @@ links:
Use the [useToast](/composables/use-toast) composable to display a toast in your application.
::important
::warning
Make sure to wrap your app with the [App](/components/app) component which uses our [Toaster](https://github.com/nuxt/ui/blob/v3/src/runtime/components/Toaster.vue) component which uses the [ToastProvider](https://www.radix-vue.com/components/toast.html#provider) component from Radix Vue.
::
@@ -91,27 +91,15 @@ Pass a `color` field to the `toast.add` method to change the color of the Toast.
options:
- name: 'color'
label: 'color'
default: 'gray'
default: neutral
items:
- primary
- green
- red
- orange
- amber
- yellow
- lime
- emerald
- teal
- cyan
- sky
- blue
- indigo
- violet
- purple
- fuchsia
- pink
- rose
- gray
- secondary
- success
- info
- warning
- error
- neutral
name: 'toast-color-example'
---
::

View File

@@ -13,7 +13,7 @@ links:
Use a [Button](/components/button) or any other component in the default slot of the Tooltip.
::important
::warning
Make sure to wrap your app with the [App](/components/app) component which uses the [TooltipProvider](https://www.radix-vue.com/components/tooltip.html#provider) component from Radix Vue.
::
@@ -33,10 +33,10 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
::
### Kbds
@@ -57,10 +57,10 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
::
::tip
@@ -82,10 +82,10 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
::
::tip
@@ -120,10 +120,10 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
::
### Arrow
@@ -142,10 +142,10 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
::
### Disabled
@@ -163,10 +163,10 @@ props:
slots:
default: |
<UButton label="Open" color="gray" variant="subtle" />
<UButton label="Open" color="neutral" variant="subtle" />
---
:u-button{label="Open" color="gray" variant="subtle"}
:u-button{label="Open" color="neutral" variant="subtle"}
::
## Examples