• Stars
    star
    1,264
  • Rank 37,217 (Top 0.8 %)
  • Language
    JavaScript
  • Created about 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SVG Vue/React components integrated from fluentui-system-icons, ionicons, ant-design-icons, material-design-icons, Font-Awesome, tabler-icons and carbon icons. (Vue3, Vue2, React, SVG)

xicons License: MIT

English · 中文

Include vicons(vue3), ricons(react), sicons(svg) & v2icons(vue2).

SVG Vue/React components integrated from fluentui-system-icons, ionicons, ant-design-icons, material-design-icons, Font-Awesome, tabler-icons and carbon.

Util icon component for customizing color & size is also provided.

Icons Preview & Search

https://www.xicons.org

Installation

Icons Installation

# Install packages on your demand
# For react
npm i -D @ricons/fluent
npm i -D @ricons/ionicons4
npm i -D @ricons/ionicons5
npm i -D @ricons/antd
npm i -D @ricons/material
npm i -D @ricons/fa # font awesome
npm i -D @ricons/tabler
npm i -D @ricons/carbon
# For vue3
npm i -D @vicons/fluent
npm i -D @vicons/ionicons4
npm i -D @vicons/ionicons5
npm i -D @vicons/antd
npm i -D @vicons/material
npm i -D @vicons/fa # font awesome
npm i -D @vicons/tabler
npm i -D @vicons/carbon
# For vue2
npm i -D @v2icons/fluent
npm i -D @v2icons/ionicons4
npm i -D @v2icons/ionicons5
npm i -D @v2icons/antd
npm i -D @v2icons/material
npm i -D @v2icons/fa # font awesome
npm i -D @v2icons/tabler
npm i -D @v2icons/carbon
# For SVG file
npm i -D @sicons/fluent
npm i -D @sicons/ionicons4
npm i -D @sicons/ionicons5
npm i -D @sicons/antd
npm i -D @sicons/material
npm i -D @sicons/fa # font awesome
npm i -D @sicons/tabler
npm i -D @sicons/carbon

Icon Utils Installation

Icon utils provide a icon wrapper component for customizing color & size of the inner SVG icon.

npm i -D @ricons/utils  # react
npm i -D @vicons/utils  # vue3
npm i -D @v2icons/utils # vue2

Usage

For Vue3

vue3 demo

<script>
  import { Money16Regular } from '@vicons/fluent'
  // or
  import Money16Regular from '@vicons/fluent/Money16Regular'

  // You can directly use the SVG component
  // or wrap it in an Icon component from @vicons/utils

  import { Icon } from '@vicons/utils'

  export default {
    components: {
      Icon,
      Money16Regular
    }
  }
</script>

<template>
  <Icon>
    <Money16Regular />
  </Icon>
</template>

Q & A

  • (Vue3) How to create a function that accepts an icon component as input in TypeScript?
import type { Component } from 'vue'

function f(iconComponent: Component) {
  // ...
}

For React

react demo

import { Money16Regular } from '@ricons/fluent'
// or
import Money16Regular from '@ricons/fluent/Money16Regular'

// You can directly use the SVG component
// or wrap it in an Icon component from @ricons/utils
import { Icon } from '@ricons/utils'

function App() {
  return (
    <Icon>
      <Money16Regular />
    </Icon>
  )
}

For Vue2

vue2 demo

<script>
  import { Money16Regular } from '@v2icons/fluent'
  // or
  import Money16Regular from '@v2icons/fluent/Money16Regular'

  // You can directly use the SVG component
  // or wrap it in an Icon component from @v2icons/utils

  import { Icon } from '@v2icons/utils'

  export default {
    components: {
      Icon,
      Money16Regular
    }
  }
</script>

<template>
  <Icon>
    <Money16Regular />
  </Icon>
</template>

For SVG

<img src="@sicons/fluent/Money16Regular.svg" />

Utils API

Icon API

An icon component (in @vicons/utils, @ricons/utils, @v2icons/utils) is provided for customizing color & size of the inner SVG icon.

prop type default description
size string | number - Size of the icon.
color string - Color of the icon.
tag string span Tag to be rendered as.

For example:

import { Icon } from '@ricons/utils' // react
import { Icon } from '@vicons/utils' // vue3
import { Icon } from '@v2icons/utils' // vue2

// render it
;<Icon color="green" size="48">
  <SomeIcon />
</Icon>

IconConfigProvider API

IconConfigProvider will affect all the descendant Icons' default prop value.

prop type default description
size string | number - Size of the icon.
color string - Color of the icon.
tag string span Tag to be rendered as.

For example:

import { IconConfigProvider, Icon } from '@ricons/utils'  // react
import { IconConfigProvider, Icon } from '@vicons/utils'  // vue3
import { IconConfigProvider, Icon } from '@v2icons/utils' // vue2

// render it
;<IconConfigProvider color="green" size="48">
  <App>
    <Icon>
      <SomeIcon />
    </Icon>
  <App/>
</IconConfigProvider>

Common Issues

too many open files

This is because the count of opened files exceeds the limit of operation system.

Use ulimit -n to check the limit.

You can only increase the limit or import icons by path:

import Money16Regular from '@ricons/fluent/Money16Regular'

Icon Utils Packages

package version description
@ricons/utils npm version Util icon components for react.
@vicons/utils npm version Util icon components for vue3.
@v2icons/utils npm version Util icon components for vue2.

Icon Packages

Vue3

package version
@vicons/fluent npm version
@vicons/ionicons4 npm version
@vicons/ionicons5 npm version
@vicons/antd npm version
@vicons/material npm version
@vicons/fa npm version
@vicons/tabler npm version
@vicons/carbon npm version

React

package version
@ricons/fluent npm version
@ricons/ionicons4 npm version
@ricons/ionicons5 npm version
@ricons/antd npm version
@ricons/material npm version
@ricons/fa npm version
@ricons/tabler npm version
@ricons/carbon npm version

Vue2

package version
@v2icons/fluent npm version
@v2icons/ionicons4 npm version
@v2icons/ionicons5 npm version
@v2icons/antd npm version
@v2icons/material npm version
@v2icons/fa npm version
@v2icons/tabler npm version
@v2icons/carbon npm version

SVG

package version
@sicons/fluent npm version
@sicons/ionicons4 npm version
@sicons/ionicons5 npm version
@sicons/antd npm version
@sicons/material npm version
@sicons/fa npm version
@sicons/tabler npm version
@sicons/carbon npm version

Credit

Icon Set License
ant-design-icons MIT
fluentui-system-icons MIT
Font-Awesome CC BY 4.0 License
ionicons MIT
material-design-icons Apache 2
tabler-icons MIT
carbon Apache 2

More Repositories

1

vueuc

Util Components for Vue
TypeScript
266
star
2

css-render

Generating CSS using JS with considerable flexibility and extensibility, at both server side and client side.
TypeScript
203
star
3

treemate

Manipulating tree data structure for user interface
TypeScript
148
star
4

vfonts

CSS
72
star
5

lyla

A fully typed HTTP client with explicit behavior & error handling.
TypeScript
64
star
6

naive-ui-nuxt-demo

Vue
52
star
7

vooks

Utils Composable for Vue
TypeScript
47
star
8

naive-ui-vite-ssr

An example of naive-ui vite ssr.
JavaScript
36
star
9

evtd

Event delegation with native events and extended events.
TypeScript
23
star
10

component-tree-data-share

关于组件库树形数据的一次分享
22
star
11

seemly

TypeScript
21
star
12

nuxtjs-naive-ui

The official nuxt module for naive-ui that supports Nuxt.js SSR.
TypeScript
17
star
13

event-tracker-wrapper

Event tracker wrapper.
TypeScript
15
star
14

vdirs

Helper directives for Vue
TypeScript
14
star
15

vue3-programming-share

CSS
7
star
16

misclint

TypeScript
6
star
17

maintainable-vue-project-share

Vue
5
star
18

vue3-programming-share-2

CSS
5
star
19

naive-ui-vitepress-demo

This is a demo for using `naive-ui` in `vitepress` with SSR enabled.
TypeScript
4
star
20

demoup

TypeScript
3
star
21

irw

TypeScript
3
star
22

store4mp

A very basic data store manager library for mini program (mainly for cross-page usage)
TypeScript
3
star
23

v2s

Convert vue to script.
JavaScript
3
star
24

sstimer

A super simple timer that can start, stop & fire finish callback.
TypeScript
3
star
25

boom

JavaScript
2
star
26

07akioni

2
star
27

naming-convention-types

TypeScript
2
star
28

figma-plugin-image-info

JavaScript
2
star
29

create-merged-request

Merge scattered requests into one, distribute corresponding result to requestor.
TypeScript
2
star
30

maybe-a-bug-of-volar

Vue
1
star
31

dag-maker

A frontend for dagre & dagre-d3 that draws elegant DAG.
JavaScript
1
star
32

karma-boilerplate

JavaScript
1
star
33

taro-example

JavaScript
1
star
34

vue-create-ssr-app-issue

JavaScript
1
star
35

pkuhole-fetcher-pwa

An PWA for pkuhole-fetcher.
JavaScript
1
star
36

tailwind-color-interpolation

Linear interpolation color set for tailwind CSS
HTML
1
star
37

tex-assignment-template

TeX
1
star