1 Star 1 Fork 0

uiw / icons

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

uiw-icons

Packagist Packagist

The premium icon font for uiwjs Component Library. Designed 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

# v1.x +
npm install uiw-iconfont --save
# v2.x 
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]',
      }
    }
  ]
},

React

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

License

Created By svgtofont, Licensed under the MIT License.

MIT License Copyright (c) 2019 uiw Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

@uiw 组件库的高级图标字体。 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/uiw/icons.git
git@gitee.com:uiw/icons.git
uiw
icons
icons
master

搜索帮助