# feathericons/feather architecture

> Architecture diagram of the GitHub repository feathericons/feather, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/feathericons/feather
- Repository: https://github.com/feathericons/feather

## Overview

Feather is an icon collection and JavaScript API for using its SVGs. The main runtime workflow exposes named icons, turns an icon into SVG markup, and can replace browser elements marked with `data-feather`. The repository also includes asset-generation utilities for icon data, standalone SVGs, and SVG sprites. The README documents direct SVG and Figma use as additional distribution options; source excerpts do not show how those external offerings are produced. Some generator relationships are supported only by the source index.

Main entry points: [`src/icons.js`](https://github.com/feathericons/feather/blob/main/src/icons.js) (Icon Catalog), [`src/index.js`](https://github.com/feathericons/feather/blob/main/src/index.js) (Public API), [`src/replace.js`](https://github.com/feathericons/feather/blob/main/src/replace.js) (DOM Replacement), [`src/default-attrs.json`](https://github.com/feathericons/feather/blob/main/src/default-attrs.json) (Default Attributes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_assets["Icon Assets"]
  node_icon_files["Icon SVGs"]
  node_default_attrs["Default Attributes<br/>[default-attrs.json]"]
  node_tags["Icon Tags<br/>[tags.json]"]
end

subgraph group_runtime["JavaScript Runtime"]
  node_icon_catalog["Icon Catalog<br/>[icons.js]"]
  node_icon_class["Icon Model<br/>[icon.js]"]
  node_api["Public API<br/>[index.js]"]
  node_svg_renderer["SVG Renderer<br/>[to-svg.js]"]
  node_dom_replace["DOM Replacement<br/>[replace.js]"]
end

subgraph group_generators["Asset Generators"]
  node_icon_json_builder["Icon JSON Builder"]
  node_icon_object_builder["Icon Object Builder"]
  node_standalone_builder["Standalone SVG Builder<br/>[build-svgs.js]"]
  node_sprite_builder["Sprite Builder<br/>[build-sprite.js]"]
  node_sprite_string["Sprite String Builder"]
  node_optimizer_runner["SVG Optimizer Runner<br/>[optimize-svgs.js]"]
  node_optimizer["SVG Optimizer<br/>[optimize-svg.js]"]
end

subgraph group_delivery["SVG Delivery"]
  node_standalone_svgs["Standalone SVGs"]
  node_svg_sprite["SVG Sprite<br/>[build-sprite.js]"]
  node_direct_svg["Direct SVG Use"]
  node_figma["Figma Library"]
end

node_user(("Application User"))
node_browser_dom["Browser DOM"]

node_icon_json_builder -->|"reads"| node_icon_files
node_icon_json_builder -->|"calls"| node_icon_object_builder
node_icon_catalog -->|"instantiates"| node_icon_class
node_icon_catalog -->|"reads"| node_tags
node_icon_class -->|"uses"| node_default_attrs
node_api -->|"exports"| node_icon_catalog
node_api -->|"exports"| node_svg_renderer
node_api -->|"exports"| node_dom_replace
node_user -->|"uses"| node_api
node_svg_renderer -->|"reads"| node_icon_catalog
node_dom_replace -->|"reads"| node_icon_catalog
node_dom_replace -->|"replaces elements"| node_browser_dom
node_user -->|"requests replacement"| node_dom_replace
node_standalone_builder -->|"reads"| node_icon_catalog
node_standalone_builder -->|"writes"| node_standalone_svgs
node_sprite_builder -->|"calls"| node_sprite_string
node_sprite_string -->|"uses"| node_default_attrs
node_sprite_builder -.->|"writes"| node_svg_sprite
node_optimizer_runner -->|"calls"| node_optimizer
node_optimizer -->|"uses"| node_default_attrs
node_user -->|"uses"| node_direct_svg
node_user -->|"uses"| node_figma

click node_icon_files "https://github.com/feathericons/feather/tree/main/icons"
click node_icon_json_builder "https://github.com/feathericons/feather/blob/main/bin/build-icons-json.js"
click node_icon_object_builder "https://github.com/feathericons/feather/blob/main/bin/build-icons-object.js"
click node_icon_catalog "https://github.com/feathericons/feather/blob/main/src/icons.js"
click node_icon_class "https://github.com/feathericons/feather/blob/main/src/icon.js"
click node_default_attrs "https://github.com/feathericons/feather/blob/main/src/default-attrs.json"
click node_tags "https://github.com/feathericons/feather/blob/main/src/tags.json"
click node_api "https://github.com/feathericons/feather/blob/main/src/index.js"
click node_svg_renderer "https://github.com/feathericons/feather/blob/main/src/to-svg.js"
click node_dom_replace "https://github.com/feathericons/feather/blob/main/src/replace.js"
click node_standalone_builder "https://github.com/feathericons/feather/blob/main/bin/build-svgs.js"
click node_sprite_builder "https://github.com/feathericons/feather/blob/main/bin/build-sprite.js"
click node_sprite_string "https://github.com/feathericons/feather/blob/main/bin/build-sprite-string.js"
click node_optimizer_runner "https://github.com/feathericons/feather/blob/main/bin/optimize-svgs.js"
click node_optimizer "https://github.com/feathericons/feather/blob/main/bin/optimize-svg.js"
click node_standalone_svgs "https://github.com/feathericons/feather/tree/main/icons"
click node_svg_sprite "https://github.com/feathericons/feather/blob/main/bin/build-sprite.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_icon_files,node_default_attrs,node_tags,node_user,node_browser_dom toneBlue
class node_icon_catalog,node_icon_class,node_api,node_svg_renderer,node_dom_replace toneAmber
class node_icon_json_builder,node_icon_object_builder,node_standalone_builder,node_sprite_builder,node_sprite_string,node_optimizer_runner,node_optimizer toneMint
class node_standalone_svgs,node_svg_sprite,node_direct_svg,node_figma toneRose
```

## Components

### Icon Assets

- [Icon SVGs](https://github.com/feathericons/feather/tree/main/icons): `icons`
- [Default Attributes](https://github.com/feathericons/feather/blob/main/src/default-attrs.json): `src/default-attrs.json`
- [Icon Tags](https://github.com/feathericons/feather/blob/main/src/tags.json): `src/tags.json`

### JavaScript Runtime

- [Icon Catalog](https://github.com/feathericons/feather/blob/main/src/icons.js): `src/icons.js`
- [Icon Model](https://github.com/feathericons/feather/blob/main/src/icon.js): `src/icon.js`
- [Public API](https://github.com/feathericons/feather/blob/main/src/index.js): `src/index.js`
- [SVG Renderer](https://github.com/feathericons/feather/blob/main/src/to-svg.js): `src/to-svg.js`
- [DOM Replacement](https://github.com/feathericons/feather/blob/main/src/replace.js): `src/replace.js`

### Asset Generators

- [Icon JSON Builder](https://github.com/feathericons/feather/blob/main/bin/build-icons-json.js): `bin/build-icons-json.js`
- [Icon Object Builder](https://github.com/feathericons/feather/blob/main/bin/build-icons-object.js): `bin/build-icons-object.js`
- [Standalone SVG Builder](https://github.com/feathericons/feather/blob/main/bin/build-svgs.js): `bin/build-svgs.js`
- [Sprite Builder](https://github.com/feathericons/feather/blob/main/bin/build-sprite.js): `bin/build-sprite.js`
- [Sprite String Builder](https://github.com/feathericons/feather/blob/main/bin/build-sprite-string.js): `bin/build-sprite-string.js`
- [SVG Optimizer Runner](https://github.com/feathericons/feather/blob/main/bin/optimize-svgs.js): `bin/optimize-svgs.js`
- [SVG Optimizer](https://github.com/feathericons/feather/blob/main/bin/optimize-svg.js): `bin/optimize-svg.js`

### SVG Delivery

- [Standalone SVGs](https://github.com/feathericons/feather/tree/main/icons): `icons`
- [SVG Sprite](https://github.com/feathericons/feather/blob/main/bin/build-sprite.js): `bin/build-sprite.js`
- **Direct SVG Use**
- **Figma Library**

### Other components

- **Application User**
- **Browser DOM**

## Connections

- Icon JSON Builder → Icon SVGs: reads (evidence: `bin/build-icons-json.js`)
- Icon JSON Builder → Icon Object Builder: calls (evidence: `bin/build-icons-json.js`)
- Icon Catalog → Icon Model: instantiates (evidence: `src/icons.js`)
- Icon Catalog → Icon Tags: reads (evidence: `src/icons.js`)
- Icon Model → Default Attributes: uses (evidence: `src/icon.js`)
- Public API → Icon Catalog: exports (evidence: `src/index.js`)
- Public API → SVG Renderer: exports (evidence: `src/index.js`)
- Public API → DOM Replacement: exports (evidence: `src/index.js`)
- Application User → Public API: uses (evidence: `README.md`)
- SVG Renderer → Icon Catalog: reads (evidence: `src/to-svg.js`)
- DOM Replacement → Icon Catalog: reads (evidence: `src/replace.js`)
- DOM Replacement → Browser DOM: replaces elements (evidence: `src/replace.js`)
- Application User → DOM Replacement: requests replacement (evidence: `README.md`)
- Standalone SVG Builder → Icon Catalog: reads (evidence: `bin/build-svgs.js`)
- Standalone SVG Builder → Standalone SVGs: writes (evidence: `bin/build-svgs.js`)
- Sprite Builder → Sprite String Builder: calls (evidence: `bin/build-sprite.js`)
- Sprite String Builder → Default Attributes: uses (evidence: `bin/build-sprite-string.js`)
- Sprite Builder → SVG Sprite: writes (evidence: `bin/build-sprite.js`)
- SVG Optimizer Runner → SVG Optimizer: calls (evidence: `bin/optimize-svgs.js`)
- SVG Optimizer → Default Attributes: uses (evidence: `bin/optimize-svg.js`)
- Application User → Direct SVG Use: uses (evidence: `README.md`)
- Application User → Figma Library: uses (evidence: `README.md`)
