-
Notifications
You must be signed in to change notification settings - Fork 591
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Icon)!: migrate from
@egoist/tailwindcss-icons
to new `@nuxt/i…
…con` (#1789)
- Loading branch information
1 parent
bfa2e70
commit c904604
Showing
31 changed files
with
110 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,5 @@ | ||
--- | ||
description: Display any icon (100,000+) from Iconify. | ||
links: | ||
- label: GitHub | ||
icon: i-simple-icons-github | ||
to: https://github.com/nuxt/ui/blob/dev/src/runtime/components/elements/Icon.vue | ||
description: Use 200,000+ ready to use icons from Iconify. | ||
to: https://github.com/nuxt/icon | ||
target: _blank | ||
--- | ||
|
||
## Usage | ||
|
||
Use the `name` prop by following this pattern: `i-{collection_name}-{icon_name}`. You can search any icon from [Iconify](https://iconify.design/) using https://icones.js.org. | ||
|
||
::component-card | ||
--- | ||
props: | ||
name: 'i-heroicons-light-bulb' | ||
--- | ||
:: | ||
|
||
::callout{icon="i-heroicons-exclamation-triangle"} | ||
You won't be able to use all icons in the `name` prop here as icons are bundled using [egoist/tailwindcss-icons](https://github.com/egoist/tailwindcss-icons). | ||
:: | ||
|
||
::callout{icon="i-heroicons-light-bulb"} | ||
Don't forget to install and specify the icon collections you need in your `nuxt.config.ts`, read more about this in [Theming](/getting-started/theming#icons). | ||
:: | ||
|
||
### Dynamic | ||
|
||
You can use the `dynamic` prop to enable dynamic icon loading. This will use [`nuxt-icon`](https://github.com/nuxt-modules/icon) instead and allow you to use any icon from [Iconify](https://iconify.design/) as well as the `{collection_name}:{icon_name}` pattern. | ||
|
||
This can be quite useful when using [dynamic class names](https://tailwindcss.com/docs/content-configuration#dynamic-class-names) or for icons that are not bundled by default (fetched from a database for example). | ||
|
||
::component-card | ||
--- | ||
props: | ||
name: 'i-ph-rocket-launch' | ||
dynamic: true | ||
--- | ||
:: | ||
|
||
You can also change the default behavior of the `dynamic` prop by setting the `ui.icons.dynamic` option in your `app.config.ts`. | ||
|
||
```ts [app.config.ts] | ||
export default defineAppConfig({ | ||
ui: { | ||
icons: { | ||
dynamic: true | ||
} | ||
} | ||
}) | ||
``` | ||
|
||
## Props | ||
|
||
:component-props |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,10 +34,10 @@ | |
"test": "vitest" | ||
}, | ||
"dependencies": { | ||
"@egoist/tailwindcss-icons": "^1.8.1", | ||
"@headlessui/tailwindcss": "^0.2.1", | ||
"@headlessui/vue": "^1.7.22", | ||
"@iconify-json/heroicons": "^1.1.21", | ||
"@nuxt/icon": "^1.0.0", | ||
"@nuxt/kit": "^3.12.2", | ||
"@nuxtjs/color-mode": "^3.4.1", | ||
"@nuxtjs/tailwindcss": "^6.12.0", | ||
|
@@ -51,7 +51,6 @@ | |
"@vueuse/math": "^10.11.0", | ||
"defu": "^6.1.4", | ||
"fuse.js": "^6.6.2", | ||
"nuxt-icon": "^0.6.10", | ||
"ohash": "^1.1.3", | ||
"pathe": "^1.1.2", | ||
"scule": "^1.3.0", | ||
|
@@ -71,8 +70,8 @@ | |
"release-it": "^17.3.0", | ||
"typescript": "^5.4.5", | ||
"unbuild": "^2.0.0", | ||
"valibot30": "npm:[email protected]", | ||
"valibot": "^0.31.1", | ||
"valibot30": "npm:[email protected]", | ||
"vitest": "^1.6.0", | ||
"vitest-environment-nuxt": "^1.0.0", | ||
"vue-tsc": "^2.0.16", | ||
|
Oops, something went wrong.