• Stars
    star
    138
  • Rank 259,246 (Top 6 %)
  • Language
    HTML
  • License
    MIT License
  • Created over 6 years ago
  • Updated 4 months ago

Reviews

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

Repository Details

The premium icon font for @uiwjs Component Library. https://uiwjs.github.io/icons

@uiw/icons

NPM Downloads jsDelivr CDN releases version LICENSE NPM Version

The premium icon font for uiwjs Component Library. Designed @uiw/icons by @liwen0526.

Visit https://uiwjs.github.io/icons/ and check out the search feature, which has keywords identifying common icon names and styles. For example, if you search for "arrow" we call up every icon that could possibly be used as an arrow. We've also included each icon's class name for easy copy / pasting when you're developing!

They are free to use and licensed under MIT. We intend for this icon pack to be used with uiw, but it’s by no means limited to it. Use them wherever you see fit, personal or commercial.

Installation

npm install @uiw/icons --save

HTML Example

You can use https://uiwjs.github.io/icons/ to easily find the icon you want to use. Once you've copied the desired icon's CSS classname, simply add the icon and icon's classname, such as apple to an HTML element.

You need link CSS

<link rel="stylesheet" type="text/css" href="node_modules/@uiw/icons/w-icon.css">

Used in Less:

@import "~@uiw/icons/fonts/w-icon.css";

Used in JS:

import '@uiw/icons/fonts/w-icon.css';
// or
import '@uiw/icons/fonts/w-icon.less';

note: It has a w-icon- prefix.

<i class="w-icon-apple"></i>

Or use the Unicode, You can use Unicode website to easily find the Unicode icon you want to use.

<style>
.iconfont{
  font-family: "w-icon" !important;
  font-size: 16px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -webkit-text-stroke-width: 0.2px;
  -moz-osx-font-smoothing: grayscale;
}
</style>
<span class="iconfont">&#59907;</span>

Or manually download and link **@uiw/icons** in your HTML, It can also be downloaded via UNPKG:

<link rel="stylesheet" type="text/css" href="https://unpkg.com/@uiw/icons/fonts/w-icon.css">
<span class="w-icon-adobe"></span>

In Webpack

{
  test: /w-icon\.(eot|ttf|svg)$/,
  use: [
    {
      loader: require.resolve('url-loader'),
      options: { limit: 8192 }
    },
    {
      loader: require.resolve('file-loader'),
      options: {
        name: 'static/fonts/[name].[hash:8].[ext]',
      }
    }
  ]
},

Used in React

Icons are used as components. v2.6.2+ support.

import { Adobe, Alipay } from '@uiw/icons';
import { Alipay } from '@uiw/icons/Alipay';

<Adobe style={{ fill: 'red' }} />
<Alipay height="36" />

To use SVG images as React components directly, webpack loader support is required.

Install dependencies:

yarn add @svgr/webpack file-loader

Configure webpack loader:

// webpack.config.js
{
  test: /\.svg$/,
  use: [
    {
      loader: require.resolve('@svgr/webpack'),
      options: {
        prettier: false,
        svgo: false,
        svgoConfig: {
          plugins: [{ removeViewBox: false }],
        },
        titleProp: true,
        ref: true,
      },
    },
    {
      loader: require.resolve('file-loader'),
      options: {
        name: 'static/media/[name].[hash].[ext]',
      },
    },
  ],
  issuer: {
    and: [/\.(ts|tsx|js|jsx|md|mdx)$/],
  },
},

You can then import the SVG as a React component like this:

import { ReactComponent as ComLogo } from '@uiw/icons/icon/alipay.svg';

<ComLogo />

Custom Icon Component

Create an Icon component.

import React from 'react';
import svgPaths from '@uiw/icons/fonts/w-icon.json';

const renderSvgPaths = (type) => {
  const pathStrings = svgPaths[type];
  if (pathStrings == null) {
    return null
  }
  return pathStrings.map((d, i) => <path key={i} d={d} fillRule="evenodd" />)
}

export default class Icon extends React.PureComponent {
  render() {
    const { type, color } = this.props;
    if (type == null || typeof type === "boolean") {
      return null;
    }
    return (
      <svg fill={color} viewBox={`0 0 24 24`}>{this.renderSvgPaths(type)}</svg>
    );
  }
}

Use the Icon component:

const demo = () => {
  return (
    <Icon type="heart-on" />
  )
}

Development

Run the npm install to install the dependencies after cloning the project and you'll be able to:

To build *.svg *.ttf *.woff *.eot files

npm run font

To build site and push gh-pages branch

npm run start

Contributors

As always, thanks to our amazing contributors!

Made with github-action-contributors.

License

Created By svgtofont, Licensed under the MIT License.

More Repositories

1

province-city-china

🇨🇳最全最新中国【省、市、区县、乡镇街道】json,csv,sql数据
JavaScript
2,284
star
2

react-md-editor

A simple markdown editor with preview, implemented with React.js and TypeScript.
TypeScript
2,003
star
3

react-codemirror

CodeMirror 6 component for React. @codemirror https://uiwjs.github.io/react-codemirror/
TypeScript
1,484
star
4

uiw

⚛️ @uiwjs A high quality UI Toolkit, A Component Library for React 16+.
TypeScript
702
star
5

react-login-page

Some `react` login pages, which can be used quickly after installation.
TypeScript
533
star
6

react-textarea-code-editor

A simple code editor with syntax highlighting.
TypeScript
459
star
7

react-amap

基于 React 封装的高德地图组件,帮助你轻松的接入地图到 React 项目中。
TypeScript
393
star
8

react-markdown-editor

A markdown editor with preview, implemented with React.js and TypeScript.
TypeScript
299
star
9

react-monacoeditor

Monaco Editor component for React.
TypeScript
284
star
10

react-markdown-preview

React component preview markdown text in web browser. The minimal amount of CSS to replicate the GitHub Markdown style. Support dark-mode/night mode.
TypeScript
248
star
11

react-color

🎨 Is a tiny color picker widget component for React apps.
TypeScript
238
star
12

react-baidu-map

基于 React 封装的百度地图组件,支持 React Hook,帮助你轻松的接入地图到 React 项目中。
TypeScript
216
star
13

react-native-alipay

基于 React Native 的宝支付包,已更新到最新的支付宝 SDK 版本,支持Android/iOS。
Java
199
star
14

react-heat-map

A lightweight calendar heatmap react component built on SVG, customizable version of GitHub's contribution graph.
TypeScript
178
star
15

react-json-view

A React component for displaying and editing javascript arrays and JSON objects.
TypeScript
154
star
16

npm-unpkg

A web application to view npm package files, Based on unpkg.
TypeScript
99
star
17

react-split

A piece of view can be divided into areas where the width or height can be adjusted by dragging.
TypeScript
60
star
18

react-code-preview

Code edit preview for React.
TypeScript
58
star
19

react-native-uiw

A UI component library based on React Native (Android & iOS).
TypeScript
44
star
20

json-viewer

Online JSON Viewer, JSON Beautifier to beautify and tree view of JSON data - It works as JSON Pretty Print to pretty print JSON data.
TypeScript
42
star
21

react-native-amap-geolocation

React Native 高德地图定位模块,支持 Android/iOS。
Java
41
star
22

react-signature

A signature board component for react.
TypeScript
34
star
23

react-watermark

A react component that adds a watermark to an area of a web page.
TypeScript
31
star
24

react-native-wechat

React Native 包使用微信分享、登录、收藏、支付等功能,支持Android/iOS。
Java
30
star
25

file-icons

File icons in the file tree.
HTML
29
star
26

uiw-admin

UIW-Admin Panel Framework, Powered by React and @uiwjs.
TypeScript
22
star
27

babel-plugin-transform-remove-imports

Remove the specified import declaration when you use the babel transform to build the package.
JavaScript
21
star
28

react-run-web

Online Code Editor for Rapid Web Development.
TypeScript
20
star
29

react-native-template

React Native template for react-native-uiw.
JavaScript
17
star
30

react-mac-keyboard

Macbook computer keyboard style for react component.
TypeScript
17
star
31

next-remove-imports

The default behavior is to remove all .less/.css/.scss/.sass/.styl imports from all packages in node_modules.
JavaScript
17
star
32

ui-color

Converting HEX & RGB colors to UIColor/NSColor/Color for both Objective C & Swift.
TypeScript
16
star
33

copy-to-clipboard

Copy text to the clipboard in modern browsers
JavaScript
16
star
34

react-use-online

useOnline is a tiny, zero-dependency hook for responding to online/offline changes.
TypeScript
16
star
35

reset-css

A tiny modern CSS reset.
CSS
14
star
36

keycode-info

A simple web page that responds to the pressed key and returns information about the JavaScript'on-key press' key.
TypeScript
14
star
37

react-iframe

This component allows you to wrap your entire React application or each component in an <iframe>.
TypeScript
12
star
38

react-codesandbox

A React component is provided that allows you to programmatically generate codesandbox projects from code samples on the fly.
TypeScript
11
star
39

react-github-corners

Add a Github corner to your project page, This GitHub corner for react component/web component.
TypeScript
11
star
40

react-only-when

A declarative component for conditional rendering.
TypeScript
9
star
41

bootstrap-icons

Official open source SVG icon library for Bootstrap.
8
star
42

uiwjs.github.io

The official documentation site for @uiwjs. https://uiwjs.github.io
8
star
43

react-clock

An analog clock for your React app.
TypeScript
7
star
44

vscode-uiw

Preview uiw document in vscode.
TypeScript
7
star
45

react-layout

Layout component for React. Handling the overall layout of a page.
TypeScript
7
star
46

react-csv-reader

React component that handles csv file input and its parsing.
TypeScript
7
star
47

react-use-colorscheme

useColorScheme() provides access to the devices color scheme.
TypeScript
7
star
48

react-native-transport-location

Objective-C
6
star
49

react-code-preview-layout

A react component showing the layout of `code` and `code preview example`.
TypeScript
6
star
50

date-formatter

Get a formatted date.
TypeScript
6
star
51

react-prismjs

React Component for prismjs.
TypeScript
6
star
52

react-tabs-draggable

Draggable tabs for React.
TypeScript
5
star
53

react-markdown-preview-example

Preview the markdown files and run the React examples in the documentation.
TypeScript
5
star
54

react-head

React components will manage your changes to the document head
TypeScript
4
star
55

react-shields

Shields.io for react component, Quality metadata badges for open source projects.
TypeScript
4
star
56

react-codepen

A React component is provided that allows you to programmatically generate codepen projects from code samples on the fly.
TypeScript
4
star
57

react-stackblitz

A React component is provided that allows you to programmatically generate stackblitz projects from code samples on the fly.
TypeScript
4
star
58

react-back-to-top

A minimal lightweight react component for adding a nice scroll up (back to top) button with onScroll progress.
TypeScript
4
star
59

react-monorepo-template

Simple React package development project example template.
TypeScript
3
star
60

auto-gitee-mirror

Use GitHub Actions to sync from GitHub to Gitee
3
star
61

react-keywords

Highlight a keyword in a piece of text and return a React element.
TypeScript
3
star
62

css-filter

A filter CSS generator that helps you quickly generate filter CSS declarations for your website. It comes with many options and it demonstrates instantly.
TypeScript
3
star
63

babel-plugin-transform-uiw-import

Modular import plugin for babel.
JavaScript
2
star
64

react-xml-reader

React component that handles xml file input and its parsing.
TypeScript
2
star
65

rematch-loading

Loading indicator plugin for @rematch.
TypeScript
1
star
66

logo

Source files of uiw's logo.
1
star
67

.github

Welcome to the uiwjs organization.
1
star