# Technical Documentation: primer/octicons

> ℹ️ **Provenance:** Multi-Tier Ingestion · [CodeWiki Reference](https://codewiki.google/github.com/primer/octicons)

### Overview (`README.md`)

<br>
<br>

<h1 align="center">Primer Octicons</h1>

<p align="center">Octicons are a set of SVG icons built by GitHub for GitHub.</p>

<p align="center">
  <a aria-label="build status" href="https://github.com/primer/octicons/actions/workflows/ci.yml">
    <img alt="" src="https://github.com/primer/octicons/actions/workflows/ci.yml/badge.svg?branch=main&event=push">
  </a>
  <a aria-label="publish status" href="https://github.com/primer/octicons/actions/workflows/publish.yml">
    <img alt="" src="https://github.com/primer/octicons/actions/workflows/publish.yml/badge.svg">
  </a>
</p>

## Libraries

This repository contains several libraries. Each of them is in the `lib/` folder and gives access to Octicons on a different platform/language.

### JavaScript

The octicons node.js library is the main JavaScript library. With [a JavaScript API](/lib/octicons_node/README.md) that can be used in a variety of applications.

| Package                                                                                                      | Version                                                                                                                           |
| ------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
| **[@primer/octicons](/lib/octicons_node)** <br />Node.js package with JavaScript API                         | [](https://www.npmjs.org/package/@primer/octicons)               |
| **[@primer/octicons-react](/lib/octicons_react)** <br />React Octicons components                            | [](https://www.npmjs.org/package/@primer/octicons-react)   |
| **[@primer/styled-octicons](/lib/octicons_styled)** <br />React Octicons components with Styled System props | [](https://www.npmjs.org/package/@primer/styled-octicons) |

### Ruby

| Package                                                                       | Version                                                                                                       |
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| **[octicons](/lib/octicons_gem)** <br />Ruby gem with Ruby API                | [](https://rubygems.org/gems/octicons)               |
| [octicons_helper](/lib/octicons_helper)<br />Rails helper for using octicons  | [](https://rubygems.org/gems/octicons_helper) |
| [jekyll-octicons](/lib/octicons_jekyll)<br />Jekyll plugin for using octicons | [](https://rubygems.org/gems/jekyll-octicons) |

## Icon names and compatibility

The shape-based `triangle`, `triangle-circle`, and `triangle-fill` names follow the `square` family. Each provides 16px and 24px artwork. `git-pull-request-unlisted` provides 16px artwork.

| Canonical name    | Compatibility name             | Preserved behavior                                                          |
| ----------------- | ------------------------------ | --------------------------------------------------------------------------- |
| `bookmark-fill`   | `bookmark-filled` (deprecated) | The old name retains its 16px drawing at every display size.                |
| `repo-delete`     | `repo-deleted` (deprecated)    | The old name retains its 16px drawing at every display size.                |
| `triangle-circle` | `play` (supported)             | The old name retains both original circled drawings, not the bare triangle. |

Compatibility names retain their exports, CSS classes, symbol IDs, and published `build/svg` paths. An `aliasOf` property identifies the canonical name in icon data; `deprecated: true` separately marks a deprecated alias. Catalogues can filter `aliasOf` entries without removing legacy lookups.

The canonical `bookmark-fill` and `repo-delete` names now provide both natural sizes. JavaScript and Ruby helpers retain their existing 24px output when callers omit width and height; an explicit 16px request selects the 16px drawing.

## Contributing

### Feedback, ideas, and bug reports

If you found a bug, have feedback about our Octicon Library, or an idea on how to improve it, please open a new issue in this repo using the appropriate [issue template](https://github.com/primer/octicons/issues/new/choose).

### Request an Icon Review (GitHub staff only)

To request an icon review for inclusion in the Octicons Library, open the [github/primer issue template chooser](https://github.com/github/primer/issues/new/choose) and select **Icon request**.

### Adding or updating an icon

Read through our [contributing guide](./CONTRIBUTING.md#adding-or-updating-icons) if you want to add or update icons.

## License

(c) GitHub, Inc.

When using the GitHub logos, be sure to follow the [GitHub logo guidelines](https://github.com/logos).

_Code License:_ [MIT](./LICENSE)
Applies to all other files

---

### Overview (`.changeset/README.md`)

# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

---

### Overview (`lib/octicons-react-symbols/README.md`)

# @primer/octicons-react-symbols

> Optimized React components for rendering Octicons with shared SVG symbols

## Getting started

To install `@primer/octicons-react-symbols` in your project, you will need to
run the following command using [npm](https://www.npmjs.com/):

```bash
npm install -S @primer/octicons-react-symbols
```

## Usage

The `@primer/octicons-react-symbols` package provides Octicon components that
reference shared SVG symbols instead of re-creating the same SVG markup every
time an icon is rendered. This is useful in apps that render the same icons many
times, because the symbol definition can be shared while each icon renders a
small `<svg><use /></svg>` reference.

In your project, add the `OcticonSymbols` component and provide the symbols that
you would like to include.

```tsx
import {OcticonSymbols, CheckSymbol} from '@primer/octicons-react-symbols'

function RootLayout() {
  return (
    <OcticonSymbols symbols={[CheckSymbol]}>
      <App />
    </OcticonSymbols>
  )
}
```

Nested `OcticonSymbols` components only render symbols that have not already
been provided by an ancestor.

Downstream components can render icon references normally:

```tsx
import {CheckIconReference} from '@primer/octicons-react-symbols'

function Status() {
  return <CheckIconReference />
}
```

### Compatibility names

`PlaySymbol` and `PlayIconReference` remain supported circled aliases of the `TriangleCircle` pair. Alias symbols retain their own SVG IDs, so register `PlaySymbol` when rendering `PlayIconReference`. Migrate the symbol and reference names together.

The `BookmarkFilled` and `RepoDeleted` pairs remain available with deprecation guidance and their original 16px artwork. Their canonical `BookmarkFill` and `RepoDelete` pairs provide both natural sizes.

### Custom symbols

Use `createIconReference` to create a custom symbol and its matching icon
reference component. Each size includes the SVG definition and metadata used by
the reference component. The definition and `id` should reference the same SVG
symbol.

```tsx
import {createIconReference, OcticonSymbols} from '@primer/octicons-react-symbols'

const [StatusSymbol, StatusIconReference] = createIconReference({
  id: 'symbol-status',
  name: 'StatusIconReference',
  sizes: {
    '16': {
      definition: (
        <symbol id="symbol-status-16" viewBox="0 0 16 16">
          <path d="..." />
        </symbol>
      ),
      id: 'symbol-status-16',
      width: 16,
    },
    '24': {
      definition: (
        <symbol id="symbol-status-24" viewBox="0 0 24 24">
          <path d="..." />
        </symbol>
      ),
      id: 'symbol-status-24',
      width: 24,
    },
  },
})

function RootLayout() {
  return <OcticonSymbols symbols={[StatusSymbol]}>{/* Application content */}</OcticonSymbols>
}

function Status() {
  return <StatusIconReference aria-label="Success" size={24} />
}
```

---

### Overview (`lib/octicons_gem/README.md`)

# octicons 

[](https://rubygems.org/gems/octicons)

## Install

Add this to your `Gemfile`

```rb
gem 'octicons'
```

Then `bundle install`.

If using a framework like Rails, please follow the [installation instructions](https://primer.style/view-components/#installation) in the [Primer ViewComponents](https://primer.style/view-components) documentation. 

## Usage

```rb
require 'octicons'
icon = Octicons::Octicon.new("x")
icon.to_svg
# <svg class="octicon octicon-x" viewBox="0 0 16 16" width="16" height="16" version="1.1" "aria-hidden"="true"><path d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"></path></svg>
```

## Documentation

The `Octicon` class takes two arguments. The first is the symbol of the icon, and the second is a hash of arguments representing html attributes

### `symbol` _(required)_

This is the name of the octicon you want to use. For example `alert`. [Full list of icons](/)

### Options

* `:height` - When setting the height to a number, the icon will scale to that size. For example, passing `32`, will calculate the width based on the icon's natural size.
* `:width` - When setting the width to a number, the icon will scale to that size. For example, passing `32`, will calculate the width based on the icon's natural size.

If both `:width, :height` are passed into the options hash, then the icon will be sized exactly at those dimensions.

### Attributes

Once initialized, you can read a few properties from the icon.

#### `symbol`

Returns the string of the symbol name

```rb
icon = Octicons::Octicon.new("x")
icon.symbol
# "x"
```

#### `path`

Path returns the string representation of the path of the icon.

```rb
icon = Octicons::Octicon.new("x")
icon.path
# <path d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"></path>
```

#### `options`

This is a hash of all the `options` that will be added to the output tag.

```rb
icon = Octicons::Octicon.new("x")
icon.options
# {:class=>"octicon octicon-x", :viewBox=>"0 0 12 16", :version=>"1.1", :width=>12, :height=>16, :"aria-hidden"=>"true"}
```

#### `width`

Width is the icon's true width. Based on the svg view box width. _Note, this doesn't change if you scale it up with size options, it only is the natural width of the icon_

#### `height`

Height is the icon's true height. Based on the svg view box height. _Note, this doesn't change if you scale it up with size options, it only is the natural height of the icon_

#### `keywords`

Returns an array of keywords for the icon. The data comes from the [data file in lib](../data.json). Consider contributing more aliases for the icons.

```rb
icon = Octicons::Octicon.new("x")
icon.keywords
# ["remove", "close", "delete"]
```

### Methods

#### `to_svg`

Returns a string of the svg tag

```rb
icon = Octicons::Octicon.new("x")
icon.to_svg
# <svg class="octicon octicon-x" viewBox="0 0 16 16" width="16" height="16" version="1.1" "aria-hidden"="true"><path d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"></path></svg>
```

---

### Overview (`lib/octicons_helper/README.md`)

# octicons_helper

[](https://rubygems.org/gems/octicons_helper)


This rails helper lets you easily include svg octicons in your rails apps.

## Install

1. Add this to your `Gemfile`

    ```rb
    gem 'octicons_helper'
    ```

3. Use this tag in your erbs

    ```rb
    <%= octicon "alert", :height => 32,  :class => "right left", :"aria-label" => "hi" %>
    ```
We recommend including the CSS in the [`@primer/octicons`](/packages/javascript) npm module. You can also npm install that package and include `build/build.css` in your styles.

---

### Overview (`lib/octicons_jekyll/README.md`)

# jekyll-octicons

[](https://rubygems.org/gems/jekyll-octicons)

The Jekyll liquid tag is a plugin that lets you include octicons in your Jekyll sites.

## Install

1. Add this to your `Gemfile`

    ```rb
    gem 'jekyll-octicons'
    ```

2. Add this to your jekyll `_config.yml`

    ```yml
    plugins:
      - jekyll-octicons
    ```

3. Use this tag in your jekyll templates

    ```
    {% octicon alert height:32 class:"right left" aria-label:hi %}
    ```

We recommend including the CSS in the [`@primer/octicons`](/packages/javascript) npm module. You can also npm install that package and include `build/build.css` in your styles.

---

### Overview (`lib/octicons_node/README.md`)

# @primer/octicons


[](https://www.npmjs.org/package/@primer/octicons)

## Install

This package is distributed with [npm][npm]. After [installing npm][install-npm], you can install `@primer/octicons` with this command:

```shell
npm install @primer/octicons
```

## Usage

For all the usages, we recommend using the CSS located in [`build/build.css`](https://unpkg.com/@primer/octicons/build/build.css). This is some simple CSS to normalize the icons and inherit colors.

After installing `@primer/octicons` you can access the icons like this:

```js
var octicons = require("@primer/octicons")
octicons.alert
// {
//     symbol: 'alert',
//     keywords: ['warning', 'triangle', 'exclamation', 'point'],
//     toSVG: [Function]
//     heights: {
//         16: {
//             width: 16,
//             path: '<path d="M8.865 1.52c-.18-.31-.51-.5-.87-.5s-.69.19-.87.5L.275 13.5c-.18.31-.18.69 0 1 .19.31.52.5.87.5h13.7c.36 0 .69-.19.86-.5.17-.31.18-.69.01-1L8.865 1.52zM8.995 13h-2v-2h2v2zm0-3h-2V6h2v4z"/>',
//             options: {
//                 version: '1.1',
//                 width: '16',
//                 height: '16',
//                 viewBox: '0 0 16 16',
//                 class: 'octicon octicon-alert',
//                 'aria-hidden': 'true'
//             },
//         },
//         24: ...
//     }
// }
```

There will be a key for every icon, with [`toSVG`](#octiconsnametosvg) and other properties.

_Note: `alert` in the above example can be replaced with any valid icon name. Icons with multi-word names (e.g. `arrow-right`) **cannot** be accessed using dot notation (e.g. `octicons.alert`). Instead, use bracket notation (e.g. `octicons['arrow-right']`)._

### `octicons[name].symbol`

Returns the string of the symbol name, same as the key for that icon.

```js
octicons.x.symbol
// "x"
```

### `octicons[name].keywords`

Returns an array of keywords for the icon. The data comes from [keywords.json](https://github.com/primer/octicons/blob/main/keywords.json). Consider contributing more search terms for the icons.

```js
octicons.x.keywords
// ["remove", "close", "delete"]
```

### Compatibility names

An optional `aliasOf` property identifies an icon's canonical name. `play` remains a supported alias of `triangle-circle`, while `bookmark-filled` and `repo-deleted` also carry `deprecated: true`. Aliases retain their names, CSS classes, natural drawings, and published SVG paths.

```js
octicons.play.aliasOf
// "triangle-circle"

const canonicalIcons = Object.values(octicons).filter(icon => !icon.aliasOf)
```

The published `build/data.json` contains the same alias metadata and keeps legacy keys. Filter aliases only when listing canonical icons, not when resolving names used by existing callers.

### `octicons[name].heights`

Each icon can have multiple SVGs that are designed for different sizes. The `heights` property allows you to access all the SVGs for an icon using the natural height of the SVG.


```js
octicons.x.heights
// {
//     16: {
//         width: 16,
//         path: '<path d="..."/>',
//         options: {
//             version: '1.1',
//             width: '16',
//             height: '16',
//             viewBox: '0 0 16 16',
//             class: 'octicon octicon-alert',
//             'aria-hidden': 'true'
//         },
//     },
//     24: {
//         width: 24,
//         path: '<path d="..."/>',
//         options: {
//             version: '1.1',
//             width: '24',
//             height: '24',
//             viewBox: '0 0 24 24',
//             class: 'octicon octicon-alert',
//             'aria-hidden': 'true'
//         },
//     },
// }
```


### `octicons[name].heights[height].width`

Returns the icon's true width, based on the SVG view box width. _Note, this doesn't change if you scale it up with size options, it only is the natural width of the icon._

### `octicons[name].heights[height].path`

Returns the string representation of the path of the icon.

```js
octicons.x.heights[16].path
// <path d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"></path>
```

### `octicons[name].heights[height].options`

This is an object of all the attributes that will be added to the output tag.

```js
octicons.x.heights[16].options
// { version: '1.1', width: '12', height: '16', viewBox: '0 0 12 16', class: 'octicon octicon-x', 'aria-hidden': 'true' }
```

### `octicons[name].toSVG()`

Returns a string of the `<svg>` tag.

```js
octicons.x.toSVG()
// <svg version="1.1" width="12" height="16" viewBox="0 0 12 16" class="octicon octicon-x" aria-hidden="true"><path d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg>
```

The `.toSVG()` method accepts an optional `options` object. This is used to add CSS class names, accessibility options, and sizes.

`bookmark-fill` and `repo-delete` retain their 24px output without size options. Pass `{height: 16}` or `{width: 16}` to select their 16px drawings. Other existing defaults, including `play`, stay unchanged.

#### class

Add more CSS classes to the `<svg>` tag.

```js
octicons.x.toSVG({ "class": "close" })
// <svg version="1.1" width="12" height="16" viewBox="0 0 12 16" class="octicon octicon-x close" aria-hidden="true"><path d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg>
```

#### aria-label

Add accessibility `aria-label` to the icon.

```js
octicons.x.toSVG({ "aria-label": "Close the window" })
// <svg version="1.1" width="12" height="16" viewBox="0 0 12 16" class="octicon octicon-x" aria-label="Close the window" role="img"><path d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg>
```

#### width and height

Size the SVG icon larger using `width` and `height` independently or together. `.toSVG()` will automatically choose the best SVG to render based on the width or height passed in.

```js
octicons.x.toSVG({ "width": 45 })
// <svg version="1.1" width="45" height="45" viewBox="0 0 24 24" class="octicon octicon-x" aria-hidden="true"><path d="M7.48 8l3.75 3.75-1.48 1.48L6 9.48l-3.75 3.75-1.48-1.48L4.52 8 .77 4.25l1.48-1.48L6 6.52l3.75-3.75 1.48 1.48z"/></svg>
```

[primer]: https://github.com/primer/primer
[docs]: http://primercss.io/
[npm]: https://www.npmjs.com/
[install-npm]: https://docs.npmjs.com/getting-started/installing-node
[sass]: http://sass-lang.com/

---

### Overview (`lib/octicons_react/README.md`)

# @primer/octicons-react

[](https://www.npmjs.org/package/@primer/octicons-react)

## Install

```shell
npm install @primer/octicons-react
```

## Usage

### Icons

The `@primer/octicons-react` module exports individual icons as [named
exports](https://ponyfoo.com/articles/es6-modules-in-depth#named-exports). This
allows you to import only the icons that you need without blowing up your
bundle:

```jsx
import React from 'react'
import {BeakerIcon, ZapIcon} from '@primer/octicons-react'

export default function Icon({boom}) {
  return boom ? <ZapIcon /> : <BeakerIcon />
}
```

If you were to compile this example with a tool that supports [tree-shaking][]
(such as Webpack, Rollup, or Parcel) the resulting bundle would only include
the "zap" and "beaker" icons.

### Vertical alignment

By default the octicons have `vertical-align: text-bottom;` applied as inline
styles. You can change the alignment via the `verticalAlign` prop, which can be
either `middle`, `text-bottom`, `text-top`, or `top`.

```js
import {RepoIcon} from '@primer/octicons-react'

export default () => (
  <h1>
    <RepoIcon verticalAlign="middle" /> github/github
  </h1>
)
```

### `aria-label`

You have the option of adding accessibility information to the icon with the
[`aria-label` attribute][aria-label] via the `aria-label` prop.

```js
// Example usage
import {PlusIcon} from '@primer/octicons-react'

export default () => (
  <button>
    <PlusIcon aria-label="Add new item" /> New
  </button>
)
```

### `aria-labelledby`

You have the option of adding accessibility information to the icon with the
[`aria-labelledby` attribute][aria-labelledby] via the `aria-labelledby` prop. Using aria-labelledby referencing the id values of the title element provides the accessible name.

```js
// Example usage
import {PlusIcon} from '@primer/octicons-react'

export default () => (
  <button>
    <PlusIcon aria-labelledby="title" title="Add new item" /> New
  </button>
)
```

### `title`

You have the option of adding accessibility information to the icon with the
[`title` attribute][title] via the `title` prop.

### `id`

You have the option of adding information to the icon with the
[`id` attribute][id] via the `id` prop.

```js
// Example usage
import {PlusIcon} from '@primer/octicons-react'

export default () => (
  <button>
    <PlusIcon id="unique-plus-icon" /> New
  </button>
)
```

### `tabIndex`

You can add the `tabindex` attribute to an SVG element via the `tabIndex` prop if the SVG element is intended to be interactive.
`tabIndex` prop also controls the `focusable` attribute of the SVG element which is defined by SVG Tiny 1.2 and only implemented in
Internet Explorer and Microsoft Edge.

If there is no `tabIndex` prop is present (default behavior), it will set the `focusable` attribute to `false`. This is helpful
for preventing the decorative SVG from being announced by some specialized assistive technology browsing modes which can get delayed
while trying to parse the SVG markup.

```js
// Example usage
import {PlusIcon} from '@primer/octicons-react'
export default () => (
  <PlusIcon aria-label="Interactive Plus Icon" tabIndex={0} /> New Item
)
```

### Sizes

The `size` prop takes `small`, `medium`, and `large` values that can be used to
render octicons at standard sizes:

| Prop            | Rendered Size                   |
| :-------------- | :------------------------------ |
| `size='small'`  | 16px height by `computed` width |
| `size='medium'` | 32px height by `computed` width |
| `size='large'`  | 64px height by `computed` width |

```js
// Example usage
import {LogoGithubIcon} from '@primer/octicons-react'

export default () => (
  <h1>
    <a href="https://github.com">
      <LogoGithubIcon size="large" aria-label="GitHub" />
    </a>
  </h1>
)
```

### Fill

The `fill` prop takes a string value that can be used to set the color of the icon.
By default, `fill` is set to [`currentColor`](https://css-tricks.com/currentcolor/).

```js
// Example usage
import {LogoGithub} from '@primer/octicons-react'
export default () => (
  <h1>
    <a href="https://github.com">
      <LogoGithubIcon fill="#f00" />
    </a>
  </h1>
)
```

[octicons]: https://primer.style/octicons/
[primer]: https://github.com/primer/primer
[docs]: http://primercss.io/
[npm]: https://www.npmjs.com/
[install-npm]: https://docs.npmjs.com/getting-started/installing-node
[tree-shaking]: https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking
[aria-label]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label
[aria-labelledby]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby
[title]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
[id]: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id

---

### Overview (`lib/octicons_styled/README.md`)

# @primer/styled-octicons

[](https://www.npmjs.org/package/@primer/styled-octicons)

The `@primer/styled-octicons` package wraps icon components from [`@primer/octicons-react`](/packages/react) with [system props](https://primer.style/components/system-props), making them easier to style in projects that use [styled system](https://styled-system.com/)—like [Primer React](https://primer.style/components).

## Install

```shell
npm install @primer/styled-octicons
```

## Usage

`@primer/styled-octicons`  exports each icons as a named export. This allows you to import only the icons you need:

```jsx
import {AlertIcon} from '@primer/styled-octicons'

export () => (
  <AlertIcon color="red.6" mr={2} />
)
```

## System props

All icon components in `@primer/styled-octicons` get `color` and `space` system props as well as the `sx` prop. Read the Primer React [System Props](https://primer.style/components/system-props) documentation for a full list of available props.


## Props

In addition to system props, icon components in `@primer/styled-octicons` accept the same props as components in `@primer/octicons-react`:

| Name | Type | Default | Description |
| :- | :- | :-: | :- |
| aria-label | String | | Sets the [`aria-label`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute) attribute of the `<svg>`. If no `aria-label` is defined, `aria-hidden` will be set to `true`.  |
| className | String | | Sets the `class` attribute on the `<svg>`. |
| size | Number \| `"small"` \| `"medium"` \| `"large"` | `16` | The height of the icon. Width will be scaled proportionally. |
| verticalAlign | `"middle"` \| `"text-bottom"` \| `"text-top"` \| `"top"` \| `"unset"` | `"text-bottom"` | The vertical alignment of the `<svg>`. |

---

### Add Octicon Checklist (`docs/add-octicon-checklist.md`)

# Add an octicon

Use this checklist to add a new/updated octicon to the Figma library and the Octicons package. Read the [contributing guidelines](/CONTRIBUTING.md) for more information on the entire contribution process.

## Figma

- [ ] Remove white background from icon frame
- [ ] Outline all strokes of vector shape
- [ ] Union shapes
- [ ] Merge/flatten vector (cmd+e)
- [ ] Remove any unused points
- [ ] Rename vector layer "Icon"
- [ ] Vector layer color set to `text/primary`
- [ ] Name each icon frame with the canonical icon name
  - Note: Octicon names should be written lower case and use `-` to separate descriptors
  - Note: Follow established family prefixes, such as `issue-*` and `git-pull-request-*`
  - Note: Use the exact same base name for every natural size
  - Note: The 16px component uses the bare name; other sizes add one numeric suffix, such as `issue-opened-24`
- [ ] Check the Figma library and published package before reusing a name
  - Note: The same name must identify the same glyph; different artwork needs a distinct name
- [ ] If renaming, rename the existing components in place to preserve their node identities
- [ ] Copy/paste into [Octicons library file](https://www.figma.com/file/1ljgTFkT5NKNRfq5hw07JQ/Octicons?node-id=0%3A1)
- [ ] Convert the icons into components
- [ ] Place each component in the matching category frame on its size page
- [ ] Set constraints of vectors to Scale/Scale
  - Note: If adding multiple icons, use the ["All Constraints" plugin](https://www.figma.com/community/plugin/847224511609531534/All-Constraints) for bulk editing
- [ ] Add keywords to icon component
  - Note: All keywords begin with the search flag `icon: `
  - Note: Keywords should describe other metaphors that the icon can represent when searching
  - Example: The `bookmark` icon's keywords are "icon: favorite, save, bookmark"

## Octicons package

- [ ] Compare the glyph with any existing published icon of the same name; a matching name alone does not establish compatibility
- [ ] Use the [Octicons Push plugin](https://www.figma.com/community/plugin/825432045044458754/Octicons-Push) to create a pull request from Figma
- [ ] Confirm exported filenames use the canonical base name and exactly one size suffix
- [ ] Confirm every intended natural size is present and document intentional single-size coverage
- [ ] Add or update the canonical name in `keywords.json`
- [ ] For a rename, preserve the existing Figma component identity and define the old package name in `icon-metadata.json`
- [ ] Update the React public API snapshot for added or renamed exports
- [ ] Add one user-focused changeset for the icon change and select every affected package
  - Note: For a new icon, select `minor` for `@primer/octicons`, `@primer/octicons-react`, `@primer/octicons-react-symbols`, and `@primer/styled-octicons`
  - Note: `@primer/octicons-react-symbols` has an independent `0.x` version, so it must be selected explicitly
  - Note: Confirm that the changeset bot adds the linked `octicons_gem`, `octicons_helper`, and `jekyll-octicons` releases
  - Note: Do not add a separate changeset for generated files or snapshot updates
- [ ] Open created pull request in the browser and add details
  - Pull request should include:
    - [ ] Use case and relevant timeline
    - [ ] Canonical names and intended natural sizes
    - [ ] Screenshot with descriptive alt text
    - [ ] Link to icon request issue for tracking
    - [ ] Direct Figma component link for each natural size
    - [ ] Compatibility behavior or intentional single-size coverage
- [ ] Request reviewers
  - [ ] Original requestor (from issue)
  - [ ] Member of octicons team
- [ ] Submit pull request

## Automated monitoring

The weekly Primer Docs [`figma-categories`](https://github.com/github/primer-docs/blob/main/.github/workflows/figma-categories.yml) and [`figma-node-map`](https://github.com/github/primer-docs/blob/main/.github/workflows/figma-node-map.yml) workflows report suspected cross-size naming drift, missing Figma categories or component matches, and duplicate Figma component names.

These workflows provide monitoring after publication. They do not block the Octicons pull request, compare artwork between natural sizes, or prove Figma and npm SVG path parity. Complete every applicable check above before merging.

---

--- METRICS ---
- Files Extracted: 10
- Estimated Token Budget: ~7712 tokens
- Canonical Reference: https://codewiki.google/github.com/primer/octicons
