2020-04-28 09:47:35 +00:00
Iconify is the most versatile icon framework.
- Unified icon framework that can be used with any icon library.
2023-11-12 17:36:23 +00:00
- Out of the box includes 150+ icon sets with more than 200,000 icons.
2024-02-04 14:43:36 +00:00
- Embed icons in HTML with Iconify Icon web component or components for front-end frameworks.
2020-04-28 09:47:35 +00:00
- Embed icons in designs with plug-ins for Figma, Sketch and Adobe XD.
- Add icon search to your applications with Iconify Icon Finder.
For more information visit [https://iconify.design/ ](https://iconify.design/ ).
2022-05-14 10:59:41 +00:00
## Iconify parts
There are several parts of project, some are in this repository, some are in other repositories.
2020-04-28 09:57:30 +00:00
2022-05-14 10:59:41 +00:00
What is included in this repository?
2020-04-28 09:57:30 +00:00
2022-05-14 10:59:41 +00:00
- Directory `packages` contains main reusable packages: types, utilities, reusable functions used by various components.
- Directory `iconify-icon` contains `iconify-icon` web component that renders icons. It also contains wrappers for various frameworks that cannot handle web components.
- Directory `components` contains older version of icon components that are native to various frameworks, which do not use web component.
2023-01-11 15:42:21 +00:00
- Directory `plugins` contains plugins for various frameworks, which generate icons.
2020-04-28 09:57:30 +00:00
2022-05-14 10:59:41 +00:00
Other repositories you might want to look at:
2020-04-28 09:47:35 +00:00
2022-05-14 10:59:41 +00:00
- Data for all icons is available in [`iconify/icon-sets` ](https://github.com/iconify/icon-sets ) repository.
- Tools for parsing icons and generating icon sets are available in [`iconify/tools` ](https://github.com/iconify/tools ) repository.
2020-04-28 09:47:35 +00:00
2021-07-20 14:02:33 +00:00
## Iconify icon components
2020-04-28 09:47:35 +00:00
2022-05-14 10:59:41 +00:00
Main packages in this repository are various icon components.
Why are those icon components needed? Iconify icon components are not just yet another set of icon components. Unlike other icon components, Iconify icon components do not include icon data. Instead, icon data is loaded on demand from Iconify API.
2020-04-28 09:47:35 +00:00
2023-11-12 17:36:23 +00:00
Iconify API provides data for over 200,000 open source icons! API is hosted on publicly available servers, spread out geographically to make sure visitors from all over the world have the fastest possible connection with redundancies in place to make sure it is always online.
2020-04-28 09:47:35 +00:00
#### Why is API needed?
When you use an icon font, each visitor loads an entire font, even if your page only uses a few icons. This is a major downside of using icon fonts. That limits developers to one or two fonts or icon sets.
2021-07-20 14:02:33 +00:00
If you are using typical icon set that is not a font, you still need to bundle all icons used in your application, even ones that visitor does not need.
2020-04-28 10:59:36 +00:00
2021-07-20 14:02:33 +00:00
Unlike icon fonts and components for various icon sets, Iconify icon components dynamically load icon data from Iconify API whenever it is needed.
2020-04-28 10:59:36 +00:00
2021-07-20 14:02:33 +00:00
This makes it possible to have an unlimited choice of icons!
2020-04-28 09:47:35 +00:00
2022-05-14 10:59:41 +00:00
## Packages in this repository
2020-04-28 09:47:35 +00:00
2022-05-12 20:10:42 +00:00
There are several types of packages, split in their own directories.
2020-04-28 09:47:35 +00:00
2022-05-12 20:10:42 +00:00
### Main packages
2020-04-28 09:47:35 +00:00
2022-05-12 20:10:42 +00:00
Directory `packages` contains main packages that are reusable by all other packages in this repository as well as third party components.
Main packages:
2020-04-28 09:47:35 +00:00
2021-07-20 14:02:33 +00:00
- [Iconify types ](./packages/types/ ) - TypeScript types.
2021-05-24 10:25:02 +00:00
- [Iconify utils ](./packages/utils/ ) - common files used by various Iconify projects (including tools, API, etc...).
2023-05-31 19:04:11 +00:00
- [Iconify core ](./packages/core/ ) - common files used by icon components and plugins.
- [API redundancy ](./packages/api-redundancy/ ) - library for managing redundancies for loading data from API: handling timeouts, rotating hosts. It provides fallback for loading icons if main API host is unreachable.
2022-05-12 20:10:42 +00:00
2022-05-14 05:32:50 +00:00
### Web component
Directory `iconify-icon` contains `iconify-icon` web component and wrappers for various frameworks.
2022-05-16 21:27:45 +00:00
| Package | Usage |
| ---------------------------------------- | ---------- |
| [Web component ](./iconify-icon/icon/ ) | Everywhere |
| [React wrapper ](./iconify-icon/react/ ) | React |
| [SolidJS wrapper ](./iconify-icon/solid/ ) | SolidJS |
2022-05-14 05:32:50 +00:00
2022-05-16 20:00:25 +00:00
Frameworks that are confirmed to work with web components without custom wrappers:
- Svelte.
2022-05-17 08:41:40 +00:00
- Lit.
- Ember.
2022-05-16 20:00:25 +00:00
- Vue 2 and Vue 3, but requires custom config when used in Nuxt (see below).
- React, but with small differences, such as using `class` instead of `className` . Wrapper fixes it and provides types.
2022-05-14 05:32:50 +00:00
#### Demo
Directory `iconify-icon-demo` contains demo packages that show usage of `iconify-icon` web component.
- [React demo ](./iconify-icon-demo/react-demo/ ) - demo using web component with React. Run `npm run dev` to start demo.
2022-05-14 10:41:52 +00:00
- [Next.js demo ](./iconify-icon-demo/nextjs-demo/ ) - demo for web component with Next.js. Run `npm run dev` to start demo.
2022-05-14 14:04:24 +00:00
- [Svelte demo with Vite ](./iconify-icon-demo/svelte-demo/ ) - demo for web component with Svelte using Vite. Run `npm run dev` to start demo.
- [SvelteKit demo ](./iconify-icon-demo/sveltekit-demo/ ) - demo for web component with SvelteKit. Run `npm run dev` to start the demo.
2022-05-14 20:42:13 +00:00
- [Vue 3 demo ](./iconify-icon-demo/vue-demo/ ) - demo for web component with Vue 3. Run `npm run dev` to start demo.
2022-05-15 20:19:28 +00:00
- [Nuxt 3 demo ](./iconify-icon-demo/nuxt3-demo/ ) - demo for web component with Nuxt 3. Run `npm run dev` to start demo. Requires custom config, see below.
2022-05-14 21:48:08 +00:00
- [Vue 2 demo ](./iconify-icon-demo/vue2-demo/ ) - demo for web component with Vue 2. Run `npm run build` to build demo and `npm run serve` to start it.
2022-05-16 21:27:45 +00:00
- [SolidJS demo ](./iconify-icon-demo/solid-demo/ ) - demo using web component with SolidJS. Run `npm run dev` to start demo.
2022-05-17 08:41:40 +00:00
- [Lit demo ](./iconify-icon-demo/lit-demo/ ) - demo for web component with Lit. Run `npm run start` to start demo.
2022-05-14 05:32:50 +00:00
2022-05-15 20:19:28 +00:00
#### Nuxt 3 usage
2024-02-04 14:43:36 +00:00
When using web component with Nuxt 3, you need to tell Nuxt that `iconify-icon` is a custom element. Otherwise it will show few warnings in dev mode.
2022-05-15 20:19:28 +00:00
Example `nuxt.config.ts` :
```ts
export default defineNuxtConfig({
vue: {
compilerOptions: {
isCustomElement: (tag) => tag === 'iconify-icon',
},
},
});
```
This configuration change is not needed when using Vue with `@vitejs/plugin-vue` .
2022-05-12 20:10:42 +00:00
### Iconify icon components
2024-02-04 14:43:36 +00:00
Directory `components` contains native components for several frameworks:
2022-05-12 20:10:42 +00:00
2022-05-13 18:29:57 +00:00
| Package | Usage |
2022-05-12 20:10:42 +00:00
| ---------------------------------------- | ------ |
| [React component ](./components/react/ ) | React |
2024-02-04 14:43:36 +00:00
| [Vue component ](./components/vue/ ) | Vue |
2022-05-12 20:10:42 +00:00
| [Svelte component ](./components/svelte/ ) | Svelte |
2022-05-13 19:25:29 +00:00
#### Deprecation notice
2022-05-13 20:39:36 +00:00
Components in directory `components` are slowly phased out in favor of `iconify-icon` web component. Components are still maintained and supported, but it is better to switch to web component.
Functionality is identical, but web component has some advantages:
2022-05-13 19:25:29 +00:00
- No framework specific shenanigans. Events and attributes are supported for all frameworks.
- Works better with SSR (icon is rendered only in browser, but because icon is contained in shadow DOM, it does not cause hydration problems).
- Better interoperability. All parts of applicaiton reuse same web component, even if those parts are written in different frameworks.
Deprecation status:
- SVG Framework: can be replaced with `iconify-icon` .
2022-05-13 20:39:36 +00:00
- React component: can be replaced with `iconify-icon` using `@iconify-icon/react` wrapper.
2022-05-14 14:04:24 +00:00
- Svelte component: can be replaced with `iconify-icon` , does not require Svelte specific wrapper.
2022-05-14 20:42:13 +00:00
- Vue 3 component: can be replaced with `iconify-icon` , does not require Vue specific wrapper.
2024-02-04 14:43:36 +00:00
- Vue 2 component: can be replaced with `iconify-icon` , does not require Vue specific wrapper. Make sure you are not using Webpack older than version 5.
2022-05-13 19:25:29 +00:00
- Ember component: can be replaced with `iconify-icon` , does not require Ember specific wrapper.
To import web component, just import it once in your script, as per [`iconify-icon` README file ](./iconify-icon/icon/README.md ).
2022-05-12 20:10:42 +00:00
#### Demo
Directory `components-demo` contains demo packages that show usage of icon components.
- [React demo ](./components-demo/react-demo/ ) - demo for React component. Run `npm run dev` to start demo.
- [Next.js demo ](./components-demo/nextjs-demo/ ) - demo for React component with Next.js. Run `npm run dev` to start demo.
2024-02-04 14:43:36 +00:00
- [Vue demo ](./components-demo/vue-demo/ ) - demo for Vue component. Run `npm run dev` to start demo.
- [Nuxt demo ](./components-demo/nuxt3-demo/ ) - demo for Vue component with Nuxt. Run `npm run dev` to start demo.
2022-05-12 20:10:42 +00:00
- [Svelte demo with Vite ](./components-demo/svelte-demo-vite/ ) - demo for Svelte component using Vite. Run `npm run dev` to start demo.
- [SvelteKit demo ](./components-demo/sveltekit-demo/ ) - demo for SvelteKit, using Svelte component on the server and in the browser. Run `npm run dev` to start the demo.
2023-01-11 15:42:21 +00:00
### Plugins
Directory `plugins` contains plugins.
| Package | Usage |
| ------------------------------------------ | ------------ |
| [Tailwind CSS plugin ](./plugins/tailwind/ ) | Tailwind CSS |
2023-02-06 18:31:55 +00:00
#### Demo
Directory `plugins-demo` contains demo packages that show usage of plugins.
- [Tailwind demo ](./plugins-demo/tailwind-demo/ ) - demo for Tailwind CSS plugin. Run `npm run build` to build demo, open `src/index.html` in browser to see result.
2022-08-21 16:49:27 +00:00
## Installation, debugging and contributing
2020-04-28 10:27:23 +00:00
2022-08-21 16:49:27 +00:00
See [CONTRIBUTING.md ](./CONTRIBUTING.md ).
2022-07-08 10:24:51 +00:00
2022-10-25 10:16:36 +00:00
## Sponsors
< p align = "center" >
< a href = "https://github.com/sponsors/cyberalien" >
< img src = 'https://cyberalien.github.io/static/sponsors.svg' / >
< / a >
< / p >
2020-08-13 15:44:56 +00:00
## Documentation
2023-05-31 19:04:11 +00:00
Documentation for all packages is available on [Iconify documentation website ](https://iconify.design/docs/ ):
2020-08-13 15:44:56 +00:00
2023-05-31 19:04:11 +00:00
- [Types documentation ](https://iconify.design/docs/types/ ).
- [Utilities documentation ](https://iconify.design/docs/libraries/utils/ ).
- [Icon components documentation ](https://iconify.design/docs/icon-components/ ).
- [Tailwind CSS plugin documentation ](https://iconify.design/docs/usage/css/tailwind/ ).
2020-08-13 15:44:56 +00:00
2020-07-01 13:13:34 +00:00
## Licence
2020-04-28 09:47:35 +00:00
2022-04-20 16:00:21 +00:00
Iconify is licensed under MIT license.
2020-04-28 09:47:35 +00:00
2022-04-20 16:00:21 +00:00
`SPDX-License-Identifier: MIT`
Some packages of this monorepo in previous versions were dual-licensed under Apache 2.0 and GPL 2.0 licence, which was messy and confusing. This was later changed to MIT for simplicity.
2020-04-28 09:47:35 +00:00
2020-07-01 13:13:34 +00:00
This licence does not apply to icons. Icons are released under different licences, see each icon set for details.
2023-05-31 19:04:11 +00:00
Icons available by default are all licensed under various open-source licences.
2020-04-28 09:47:35 +00:00
2023-05-31 19:04:11 +00:00
© 2020-PRESENT Vjacheslav Trushkin