Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
F

feather

> 编程语言
Open source

Simply beautiful open-source icons

26.0K stars0 likes0 views
WebsiteGitHub

About

Simply beautiful open-source icons

Feather

What is Feather?

Feather is a collection of simply beautiful open-source icons. Each icon is designed on a 24x24 grid with an emphasis on simplicity, consistency, and flexibility.

https://feathericons.com

bash
npm install feather-icons

Table of contents

  • Quick start
  • Usage
    • Client-side JavaScript
    • Node
    • SVG sprite
    • Figma
  • API reference
    • feather.icons
    • feather.icons[name].toSvg()
    • feather.replace()
    • feather.toSvg() (DEPRECATED)
  • Contributing
  • Related projects
  • License

Quick start

Start with this CodePen Template to begin prototyping with Feather in the browser.

Or copy and paste the following code snippet into a blank html file.

xml
<!DOCTYPE html>
<html lang="en">
  <title></title>
  <script src="https://unpkg.com/feather-icons"></script>
  <body>
    
    <i data-feather="circle"></i>

    <script>
      feather.replace();
    </script>
  </body>
</html>

Usage

At its core, Feather is a collection of SVG files. This means that you can use Feather icons in all the same ways you can use SVGs (e.g. img, background-image, inline, object, embed, iframe). Here's a helpful article detailing the many ways SVGs can be used on the web: SVG on the Web – Implementation Options

The following are additional ways you can use Feather.

Client-side JavaScript

1. Install

[!NOTE] If you intend to use Feather with a CDN, you can skip this installation step.

Install with npm.

bash
npm install feather-icons --save

Or just copy feather.js or feather.min.js into your project directory. You don't need both feather.js and feather.min.js.

2. Include

Include feather.js or feather.min.js with a <script> tag:

xml
<script src="path/to/dist/feather.js"></script>

[!NOTE] feather.js and feather.min.js are located in the dist directory of the npm package.

Or load the script from a CDN provider:

xml

<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>

After including the script, feather will be available as a global variable.

3. Use

To use an icon on your page, add a data-feather attribute with the icon name to an element:

xml
<i data-feather="circle"></i>

See the complete list of icons at feathericons.com.

4. Replace

Call the feather.replace() method:

xml
<script>
  feather.replace();
</script>

All elements that have a data-feather attribute will be replaced with SVG markup corresponding to their data-feather attribute value. See the API Reference for more information about feather.replace().

Node

1. Install

Install with npm:

bash
npm install feather-icons --save

2. Require

javascript
const feather = require('feather-icons');

3. Use

…

See the API Reference for more information about the available properties and methods of the feather object.

SVG sprite

1. Install

[!NOTE] If you intend to use Feather with a CDN, you can skip this installation step.

Install with npm.

bash
npm install feather-icons --save

Or just copy feather-sprite.svg into your project directory.

2. Use

Include an icon on your page with the following markup:

xml
<svg
  width="24"
  height="24"
  fill="none"
  stroke="currentColor"
  stroke-width="2"
  stroke-linecap="round"
  stroke-linejoin="round"
>
  <use href="path/to/feather-sprite.svg#circle" />
</svg>

[!NOTE] circle in the above example can be replaced with any valid icon name. See the complete list of icon names at feathericons.com.

However, this markup can be simplified using a simple CSS class to avoid repetition of SVG attributes between icons:

css
.feather {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
xml
<svg class="feather">
  <use href="path/to/dist/feather-sprite.svg#circle" />
</svg>

Figma

Feather is available as a Figma component library. To use the components, log in to your Figma account and duplicate the file to your drafts.

API reference

feather.icons

An object with data about every icon.

Usage

javascript
feather.icons.x;
// {
//    name: 'x',
//    contents: '<line ... /><line ... />',
//    tags: ['cancel', 'close', 'delete', 'remove'],
//    attrs: {
//      class: 'feather feather-x',
//      xmlns: 'http://www.w3.org/2000/svg',
//      width: 24,
//      height: 24,
//      viewBox: '0 0 24 24',
//      fill: 'none',
//      stroke: 'currentColor',
//      'stroke-width': 2,
//      'stroke-linecap': 'round',
//      'stroke-linejoin': 'round',
//    },
//    toSvg: [Function],
// }

feather.icons.x.toString();
// '<line ... /><line ... />'

[!NOTE] x in the above example can be replaced with any valid icon name. See the complete list of icon names at feathericons.com. Icons with multi-word names (e.g. arrow-right) cannot be accessed using dot notation (e.g. feather.icons.x). Instead, use bracket notation (e.g. feather.icons['arrow-right']).

View Source


feather.icons[name].toSvg([attrs])

Returns an SVG string.

Parameters

Name Type Description
attrs (optional) Object Key-value pairs in the attrs object will be mapped to HTML attributes on the <svg> tag (e.g. { foo: 'bar' } maps to foo="bar"). All default attributes on the <svg> tag can be overridden with the attrs object.

[!NOTE] You might find these SVG attributes helpful for manipulating icons:

  • color
  • width
  • height
  • stroke-width
  • stroke-linecap
  • stroke-linejoin

Usage

…

View Source


feather.replace([attrs])

Replaces all elements that have a data-feather attribute with SVG markup corresponding to the element's data-feather attribute value.

Parameters

Name Type Description
attrs (optional) Object Key-value pairs in the attrs object will be mapped to HTML attributes on the <svg> tag (e.g. { foo: 'bar' } maps to foo="bar"). All default attributes on the <svg> tag can be overridden with the attrs object.

Usage

[!IMPORTANT] feather.replace() only works in a browser environment.

Simple usage:

xml
<i data-feather="circle"></i>

<script>
  feather.replace();
</script>

You can pass feather.replace() an attrs object:

xml
<i data-feather="circle"></i>

<script>
  feather.replace({ class: 'foo bar', 'stroke-width': 1 });
</script>

All attributes on the placeholder element (i.e. <i>) will be copied to the <svg> tag:

xml
<i data-feather="circle" id="my-circle" class="foo bar" stroke-width="1"></i>

<script>
  feather.replace();
</script>

View Source


feather.toSvg(name, [attrs]) (DEPRECATED)

[!WARNING] feather.toSvg() is deprecated. Please use feather.icons[name].toSvg() instead.

Returns an SVG string.

Parameters

Name Type Description
name string Icon name
attrs (optional) Object Key-value pairs in the attrs object will be mapped to HTML attributes on the <svg> tag (e.g. { foo: 'bar' } maps to foo="bar"). All default attributes on the <svg> tag can be overridden with the attrs object.

Usage

…

View Source

Contributing

For more info on how to contribute please see the contribution guidelines.

Caught a mistake or want to contribute to the documentation? Edit this page on Github

Related projects

  • feathericons.dev - Feather viewer featuring 30+ brand icons and 40+ payment services icons
  • angular-feather - Feather icons for Angular applications
  • elm-feather - Feather icons for Elm applications
  • react-feather - Feather icons as React components
  • sketch-feather - Feather icons as a Sketch library
  • vue-feather-icons - Feather icons as Vue components
  • php-feather - Feather icons as a PHP Library
  • hyva-feather - Feather icons as a Magento 2 Hyva template tag
  • [wp-php-feat

Issues· 509 open

View all issuesOpen on GitHub
  • #954

    Audience/group icon

    Updated Jul 23, 2026
  • #122

    Icon request : WhatsApp

    logo requestUpdated Jul 16, 2026
  • #58

    Icon Request: Telegram

    logo requestUpdated Jul 16, 2026
  • #321

    Icon Request: PDF File

    icon requestUpdated Jun 22, 2026
  • #1294

    WCAG compliance: feather.replace() does not allow adding desc blocks to svgs

    Updated Jun 15, 2026
  • #1292

    Bug: Current color

    bugUpdated May 12, 2026
  • #1288

    Feature Request: Add “Copy SVG” Option Alongside Download for Icons

    Updated Feb 27, 2026
  • #1289

    Icon request: Academic Cap

    icon requestUpdated Feb 8, 2026
  • #557

    Icon Request: HD icon

    icon requestUpdated Dec 30, 2025
  • #108

    Icon Request: Patreon

    logo requestUpdated Dec 29, 2025

> Tags

JavaScripticonsjavascriptsvg

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 30, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言