You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/features/icons/unocss-preset-icons.md
+69Lines changed: 69 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,75 @@ Once the UnoCSS Nuxt Module and UnoCSS Preset Icons are installed and configured
6
6
7
7
UnoCSS Preset Icons use [Iconify](https://iconify.design/) as their icon data source. You need to install the corresponding icon set in `devDependencies` following the `@iconify-json/*` pattern. For example, `@iconify-json/mdi` for [Material Design Icons](https://materialdesignicons.com/), `@iconify-json/tabler` for [Tabler](https://tabler-icons.io/). You can refer to [Icônes](https://icones.js.org/) or [Iconify](https://icon-sets.iconify.design/) for all available collections.
8
8
9
+
## Vuetify 4 built-in UnoCSS icon sets
10
+
11
+
Vuetify 4 provides pre-configured icon sets that work with UnoCSS Preset Icons. You can find the full list of available icon sets in the [Vuetify documentation](https://vuetifyjs.com/en/features/icon-fonts/#unocss-icon-sets).
12
+
13
+
To use these built-in icon sets, you need to set the `defaultSet` to `custom` in your Nuxt configuration file and register the icon set in a custom Nuxt plugin.
14
+
15
+
For example, to use the Phosphor (`ph`) icon set:
16
+
17
+
1. Install the required dependencies:
18
+
::: code-group
19
+
20
+
```bash [npm]
21
+
npm i -D @iconify-json/ph @unocss/nuxt
22
+
```
23
+
24
+
```bash [yarn]
25
+
yarn add -D @iconify-json/ph @unocss/nuxt
26
+
```
27
+
28
+
```bash [pnpm]
29
+
pnpm add -D @iconify-json/ph @unocss/nuxt
30
+
```
31
+
32
+
```bash [bun]
33
+
bun add -D @iconify-json/ph @unocss/nuxt
34
+
```
35
+
36
+
:::
37
+
38
+
2. Configure the default set in your Nuxt configuration file:
39
+
::: code-group
40
+
41
+
```ts [nuxt.config.ts]
42
+
import { defineNuxtConfig } from'nuxt/config'
43
+
44
+
exportdefaultdefineNuxtConfig({
45
+
modules: ['@unocss/nuxt', 'vuetify-nuxt-module'],
46
+
vuetify: {
47
+
vuetifyOptions: {
48
+
icons: {
49
+
defaultSet: 'custom'
50
+
}
51
+
}
52
+
}
53
+
})
54
+
```
55
+
56
+
:::
57
+
58
+
3. Create a new Nuxt plugin to register the icon set:
UnoCSS Preset Icons allows you to use any icon via `v-icon`. You need to register the `mdi` icon set to allow Vuetify to configure the icon via the `class` attribute:
0 commit comments