博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
react开源_React Icons让您可以访问数百个开源图标
阅读量:2507 次
发布时间:2019-05-11

本文共 3265 字,大约阅读时间需要 10 分钟。

react开源

Learn about a React library called React Icons that provides thousands of free, Open Source icons that you can use in your next project.

了解称为React Icons的React库,该库提供了数千个免费的开源图标,可在下一个项目中使用。

If you’re working on a React app that needs icons, check out ! It includes 9 popular Open Source icon libraries, including and .

如果您正在使用需要图标的React应用程序,请查看 ! 它包括9个流行的开源图标库,包括和 。



To get started, install the module using npm:

首先,使用npm安装模块:

$ npm install --save react-icons

React Icons exports icons as React components so it’s really intuitive:

React Icons将图标导出为React组件,因此非常直观:

import React, { Component } from 'react';import { FaHeart } from "react-icons/fa";  // Font Awesomeclass App extends Component {  render() {    return (      
Hello World
) }}

所有您可以出口! (All You Can Export!)

Since react-icons includes 9 icon libraries, you’ll always find several variations of an icon. If you’re always on the never-ending quest to find the icon that’s “just right” this is for you! 👌

由于react-icons包含9个图标库,因此您始终会发现图标的多种变体。 如果您一直在不停地寻找“恰到好处”的图标,那么这就是给您的! 👌

import { FaCheck } from "react-icons/fa";       // Font Awesomeimport { IoMdCheckmark } from "react-icons/io"; // Ioniconsimport { MdCheck } from "react-icons/md";       // Material Designimport { GoCheck } from "react-icons/go";       // Github Octicon

自定义样式 (Customizing Styles)

Icons will generally inherit CSS styles, but if you’d like more customization power you can pass props to your icons.

图标通常会继承CSS样式,但是如果您想要更多的自定义功能,则可以将prop传递给图标。

In the example below, color and size are unique to react-icon, but you can also pass the standard style prop:

在下面的示例中, colorsizereact-icon唯一的,但是您也可以传递标准style prop:

轻巧和捆绑式 (Lightweight & Bundler-friendly)

Despite React Icons containing hundreds of icons, it’s doesn’t leave a big footprint in your bundle.

尽管React Icons包含数百个图标,但它并没有在您的程序包中留下很大的足迹。

Webpack /包裹优化 (Webpack/Parcel optimizations)

react-icons has a configuration in its package.json file to instruct bundlers to perform when building your app. This means only icons you explicitly import gets bundled!

react-iconspackage.json文件中具有配置,以指示捆绑程序在构建应用程序时执行 。 这意味着仅捆绑了您明确import图标!

SVG格式 (SVG format)

All of the icons in react-icons are SVG (scalable vector graphics). This means significantly smaller file sizes per icon than if they were raster image formats (like *.jpeg or *.png). SVG files are generally orders of magnitude smaller than other image formats, especially for things like icons!

react-icons中的所有react-icons均为SVG(可缩放矢量图形)。 这意味着每个图标的文件大小比栅格图像格式(例如*.jpeg*.png )要小得多。 SVG文件通常比其他图像格式小几个数量级,尤其是对于图标之类的东西!

开源友好 (Open Source Friendly)

You can use react-icons in any non-commercial/commercial projects because of the permissive licenses of each of the libraries:

由于每个库的许可,您可以在任何非商业/商业项目中使用react-icons

  • Font Awesome  CC BY 4.0 License

    Font Awesome CC BY 4.0许可

  • Ionicons  MIT

    离子离子麻省理工学院

  • Material Design icons  Apache License Version 2.0

    物料设计图标 Apache许可证版本2.0

  • Typicons  CC BY-SA 3.0

    Typicons CC BY-SA 3.0

  • Github Octicons icons  MIT

    麻省理工学院Github Octicons图标

  • Feather  MIT

    羽毛 MIT

react-icons itself is released under the MIT license.

react-icons本身是根据MIT许可发布的。

Note: View the collection of icons included in react-icons on their

注意 :在其上查看包含在react-icons的图标的集合

翻译自:

react开源

转载地址:http://cthgb.baihongyu.com/

你可能感兴趣的文章
suse如何修改ssh端口为2222?
查看>>
详细理解“>/dev/null 2>&1”
查看>>
suse如何创建定时任务?
查看>>
suse搭建ftp服务器方法
查看>>
centos虚拟机设置共享文件夹并通过我的电脑访问[增加smbd端口修改]
查看>>
文件拷贝(IFileOperation::CopyItem)
查看>>
MapReduce的 Speculative Execution机制
查看>>
大数据学习之路------借助HDP SANDBOX开始学习
查看>>
Hadoop基础学习:基于Hortonworks HDP
查看>>
为什么linux安装程序 都要放到/usr/local目录下
查看>>
Hive安装前扫盲之Derby和Metastore
查看>>
永久修改PATH环境变量的几种办法
查看>>
大数据学习之HDP SANDBOX开始学习
查看>>
Hive Beeline使用
查看>>
Centos6安装图形界面(hdp不需要,hdp直接从github上下载数据即可)
查看>>
CentOS7 中把yum源更换成163源
查看>>
关于yum Error: Cannot retrieve repository metadata (repomd.xml) for repository:xxxxxx.
查看>>
2020-11-18
查看>>
Docker面试题(二)
查看>>
【NOI 2018】归程(Kruskal重构树)
查看>>