Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Octicons v2 👀 #370

Merged
merged 130 commits into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from 128 commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
8f7bc17
Update package names
colebemis Feb 18, 2020
c52cf6f
Update FIGMA_FILE_URL
colebemis Feb 18, 2020
79cafa1
Update node tests
colebemis Feb 18, 2020
3349bbd
Wrap React icon components with React.Fragment
colebemis Feb 18, 2020
bdfe1a7
Update octicons_react tests
colebemis Feb 18, 2020
3507ad6
Update ts tests
colebemis Feb 18, 2020
752a1e7
Update gem tests
colebemis Feb 18, 2020
95fd1c2
Update jekyll tests
colebemis Feb 19, 2020
9fd5b7c
namespace helper for new octicons as octicon_v2
joelhawksley Feb 20, 2020
7ac1a72
Merge pull request #371 from primer/ruby-namespace
joelhawksley Feb 20, 2020
97bbdc1
Merge remote-tracking branch 'origin/master' into v2
colebemis Feb 28, 2020
06b15aa
Use v2 icons
colebemis Feb 28, 2020
6e304cc
Update ts-tests
colebemis Feb 28, 2020
36648fb
Merge remote-tracking branch 'origin/master' into v2
colebemis Mar 6, 2020
60ee16f
Merge remote-tracking branch 'origin/master' into v2
colebemis Mar 14, 2020
389833c
Update build script
colebemis Mar 14, 2020
d0dcfd8
Append height to all filenames
colebemis Mar 14, 2020
87b25e3
Clean up build script
colebemis Mar 14, 2020
02e329f
Add 24px svgs
colebemis Mar 16, 2020
de503da
Update ruby gem
colebemis Mar 16, 2020
8a9dc87
Remove 24 directory
colebemis Mar 16, 2020
6d93160
Update lib/octicons_gem/lib/octicons_v2/octicon_v2.rb
colebemis Mar 17, 2020
ee985d0
Update lib/octicons_gem/lib/octicons_v2/octicon_v2.rb
colebemis Mar 17, 2020
7a6dc7e
Update homepage to show all sizes
colebemis Mar 17, 2020
088d411
Create pages for all sizes
colebemis Mar 17, 2020
e3472db
Update 24px icons
colebemis Mar 17, 2020
188b954
Update lib/octicons_gem/lib/octicons_v2/octicon_v2.rb
colebemis Mar 17, 2020
daa204c
Use tab nav instead of underline nav
colebemis Mar 19, 2020
de5e3b9
Update variable names to distinguish between "height" and "natural he…
colebemis Mar 24, 2020
56fc82c
Use string keys
colebemis Mar 24, 2020
36ed06b
Add deeper asserts to octicons test
colebemis Mar 24, 2020
2d990dc
Remove trailing whitespace
colebemis Mar 24, 2020
98c8941
Make node package pass tests
colebemis Mar 31, 2020
257e18e
Update react package to pass tests
colebemis Mar 31, 2020
fcf1e9b
Update lib/octicons_node/index.js
colebemis Mar 31, 2020
8cda2bd
Merge remote-tracking branch 'origin/master' into v2
colebemis Mar 31, 2020
c2e7d8b
Remove grabber-3
colebemis Apr 8, 2020
16b4984
Rename "desktop-device-24" to "device-desktop-24"
colebemis Apr 8, 2020
aad2f1f
Update React package to support 24px icons (#395)
colebemis Apr 13, 2020
cbd6e07
"ariaLabel" to "aria-label"
colebemis Apr 13, 2020
b690a3c
Update ts-test
colebemis Apr 13, 2020
69f988f
Fix "people" and "person" naming in 24px icons
colebemis Apr 15, 2020
2766949
Rename request-changes to diff
colebemis Apr 15, 2020
61b6959
Deprecate Octicon component (#399)
colebemis Apr 17, 2020
4030236
Update lightbulb (#400)
colebemis Apr 21, 2020
e444926
Add no-entry and report icons (#403)
colebemis Apr 21, 2020
ff67761
Set sideEffects to false
colebemis Apr 22, 2020
b78cceb
Remove iconsByName for now
colebemis Apr 22, 2020
43b7ab3
Update ts-tests
colebemis Apr 22, 2020
7ac3fa1
Update CHANGELOG
colebemis Apr 22, 2020
a758ab0
Update docs
colebemis Apr 22, 2020
be2ea3b
Remove iconsByName and getIconByName for real
colebemis Apr 22, 2020
8637b19
Merge remote-tracking branch 'origin/master' into v2
colebemis Apr 22, 2020
6604d07
Update version in package.json
colebemis Apr 22, 2020
4eeecfd
Update javascript docs
colebemis Apr 22, 2020
f1ac3ad
Update jekyll docs
colebemis Apr 22, 2020
38db61f
Update rails docs
colebemis Apr 22, 2020
5a532bd
Update react docs
colebemis Apr 22, 2020
46ee127
Update ruby docs
colebemis Apr 22, 2020
74ef88e
Update jekyll package to use octicons_v2
colebemis Apr 22, 2020
8e64a12
Update doctocat
colebemis Apr 22, 2020
828a9ce
Add warning on homepage
colebemis Apr 22, 2020
4cf3be3
Update homepage layout
colebemis Apr 22, 2020
e4686db
Fix jekyll require
colebemis Apr 22, 2020
6b859f7
Merge branch 'v2' into tree-shaking
colebemis Apr 22, 2020
ac27539
Merge pull request #405 from primer/tree-shaking
colebemis Apr 22, 2020
b9eaacd
Start styled-octicons package
colebemis Apr 24, 2020
1a0ce68
Attempt to add styled octicons package to workflow
colebemis Apr 24, 2020
cedfc45
Remove next site from styled octicons package
colebemis Apr 24, 2020
44a8bc7
Add package-lock
colebemis Apr 24, 2020
9f56fa6
Add files to package.json
colebemis Apr 24, 2020
52b26a5
Update dependencies
colebemis Apr 24, 2020
a0de56e
Ad types
colebemis Apr 27, 2020
bd0d1dd
Add types for system props
colebemis Apr 27, 2020
7f5b09c
Update tests
colebemis Apr 27, 2020
f670ef5
Remove display prop
colebemis Apr 27, 2020
aca723e
Add tests for system props
colebemis Apr 27, 2020
3751a86
Update ts-tests
colebemis Apr 27, 2020
07a0bc8
Add @types/styled-system as a dependency
colebemis Apr 27, 2020
79962a1
Add name to workflow steps
colebemis Apr 27, 2020
d8dffb8
Start docs for styled-octicons
colebemis Apr 27, 2020
0c5fcfc
Remove prop types
colebemis Apr 27, 2020
dddece5
Update docs
colebemis Apr 29, 2020
fc97238
Merge remote-tracking branch 'origin/master' into v2
colebemis Apr 29, 2020
2956111
Optimize v2 icons (#419)
colebemis Apr 29, 2020
4938735
Add logo icons to v2 branch (#421)
colebemis Apr 30, 2020
eaf310a
Remove kebab-vertical icon
colebemis Apr 30, 2020
ae29ea7
Write icon components into their own file
colebemis May 1, 2020
92d68d5
Fix generated pathname
colebemis May 1, 2020
24cce42
Fix lint error
colebemis May 1, 2020
a1fb469
Bundle individual icons
colebemis May 1, 2020
44c5a6d
Write copy script
colebemis May 1, 2020
ba674af
Update package lock
colebemis May 1, 2020
af9c04b
Add sx prop
colebemis May 1, 2020
ba70d35
Update lib/octicons_styled/script/copy.sh
colebemis May 1, 2020
394a15b
Run copy script after rollup
colebemis May 1, 2020
c36f7e4
Merge branch 'styled-octicons' of github.com:primer/octicons into sty…
colebemis May 1, 2020
7c415e0
Update docs
colebemis May 4, 2020
35511fe
Export Icon and IconProps
colebemis May 4, 2020
df8e278
Merge remote-tracking branch 'origin/v2' into styled-octicons
colebemis May 4, 2020
e6dc949
Pass height as a number instead of string
colebemis May 6, 2020
917627c
Add more migration info to CHANGELOG (#422)
colebemis May 7, 2020
0ccdd71
Merge pull request #417 from primer/styled-octicons
May 7, 2020
b3d7936
Add UI examples on icon pages (#423)
colebemis May 11, 2020
1a642ac
Add React usage example to icon page (#424)
colebemis May 13, 2020
53e900d
Change prefix to octicons-v2 (#428)
colebemis May 22, 2020
5f3829a
Merge remote-tracking branch 'origin/master' into v2
colebemis Jun 1, 2020
b988812
Save sun-24.svg, moon-24.svg, sun-16.svg, moon-16.svg
ashygee Jun 1, 2020
2c1a840
Optimize SVGs
actions-user Jun 1, 2020
436cd2c
remove bg from moon-16
ashygee Jun 1, 2020
37767fe
Optimize SVGs
actions-user Jun 1, 2020
76f5f2b
Merge remote-tracking branch 'origin/v2' into add-sun-moon
colebemis Jun 1, 2020
256cc72
Merge pull request #437 from primer/add-sun-moon
ashygee Jun 1, 2020
e54379b
Add briefcase icon (#434)
colebemis Jun 2, 2020
a423abb
Add ellipsis icon (#435)
colebemis Jun 2, 2020
37939a1
Add ruby icon (#436)
colebemis Jun 2, 2020
94d0d86
Update CHANGELOG table
colebemis Jun 3, 2020
ff9cdef
Add square icon (#439)
colebemis Jun 3, 2020
a58c58c
Add zap icon (#438)
colebemis Jun 5, 2020
1cb16f5
Add meter icon (#441)
colebemis Jun 8, 2020
fb17b1e
Add paintbrush icon (#440)
colebemis Jun 9, 2020
0823bfd
Add squirrel icon (#444)
colebemis Jun 9, 2020
0ea8199
Remove now added icons from v2 changelog (#446)
FloEdelmann Jun 9, 2020
387b0bb
Add some v1 icons to v2 branch (#448)
colebemis Jun 10, 2020
dcc6a36
Update JavaScript package to support 24px icons (#445)
colebemis Jun 10, 2020
4feef6b
Remove "v2" from package names (#449)
colebemis Jun 10, 2020
c902354
Update CHANGELOG.md
colebemis Jun 10, 2020
d56a724
Update docs/content/packages/javascript.mdx
colebemis Jun 10, 2020
76baad6
Update docs/content/packages/jekyll.mdx
colebemis Jun 10, 2020
8e7b0cd
Update docs/content/packages/react.mdx
colebemis Jun 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 8 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,15 @@ jobs:
with:
name: octicons
path: ./lib/build
- uses: ./.github/actions/build_node
- name: Build @primer/octicons-react
uses: ./.github/actions/build_node
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
with:
args: octicons_react
- name: Build @primer/styled-octicons
uses: ./.github/actions/build_node
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
with:
args: octicons_styled
182 changes: 178 additions & 4 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The octicons node.js library is the main JavaScript library. With [a JavaScript

### Request a new icon

To request a new icon, open an issue using the [icon request](https://github.com/primer/octicons-v2/issues/new?assignees=&template=icon-request.md&title=%5BIcon+request%5D) template.
To request a new icon, open an issue using the [icon request](https://github.com/primer/octicons/issues/new?assignees=&template=icon-request.md&title=%5BIcon+request%5D) template.

### Adding or updating an icon

Expand Down
10 changes: 2 additions & 8 deletions docs/content/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@ title: Octicons

import {HeroLayout} from '@primer/gatsby-theme-doctocat'
import Icons from '../src/components/icons'
import {Flash, Button, Flex} from '@primer/components'
import {Flash, Button, Flex, Link} from '@primer/components'
import {Link as GatsbyLink} from 'gatsby'

export default HeroLayout

<Flash mb={4}>
<Flex flexDirection={['column', 'row']} alignItems={["flex-start", "center"]} justifyContent="space-between">
<Text>We're working on a new look for Octicons</Text>
<Button as="a" href="https://primer.style/octicons-v2/" mt={[3, 0]}>Check it out</Button>
</Flex>
</Flash>

<Icons />
99 changes: 69 additions & 30 deletions docs/content/packages/javascript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,26 @@ After installing `@primer/octicons` you can access the icons like this:
```js
var octicons = require("@primer/octicons")
octicons.alert
// { keywords: [ 'warning', 'triangle', 'exclamation', 'point' ],
// 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"/>',
// height: '16',
// width: '16',
// symbol: 'alert',
// options:
// { version: '1.1',
// width: '16',
// height: '16',
// viewBox: '0 0 16 16',
// class: 'octicon octicon-alert',
// 'aria-hidden': 'true' },
// toSVG: [Function] }
// {
// 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.
Expand All @@ -51,39 +58,71 @@ octicons.x.symbol
// "x"
```

### `octicons[name].path`
### `octicons[name].keywords`

Returns the string representation of the path of the icon.
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.

```js
octicons.x.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.x.keywords
// ["remove", "close", "delete"]
```

### `octicons[name].options`
### `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.

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

```js
octicons.x.options
// { version: '1.1', width: '12', height: '16', viewBox: '0 0 12 16', class: 'octicon octicon-x', 'aria-hidden': 'true' }
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].width`

### `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].height`
### `octicons[name].heights[height].path`

Returns 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._
Returns the string representation of the path of the icon.

### `keywords`
```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>
```

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.
### `octicons[name].heights[height].options`

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

```js
octicons.x.keywords
// ["remove", "close", "delete"]
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()`
Expand Down Expand Up @@ -117,11 +156,11 @@ octicons.x.toSVG({ "aria-label": "Close the window" })

#### width & height

Size the SVG icon larger using `width` & `height` independently or together.
Size the SVG icon larger using `width` & `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="60" 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>
// <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
Expand Down
3 changes: 2 additions & 1 deletion docs/content/packages/jekyll.mdx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
title: Jekyll
status: Stable
status: Stable
colebemis marked this conversation as resolved.
Show resolved Hide resolved
source: 'https://github.com/primer/octicons/tree/master/lib/octicons_jekyll'
---

[![Gem version](https://img.shields.io/gem/v/jekyll-octicons.svg)](https://rubygems.org/gems/jekyll-octicons)


This jekyll liquid tag is a plugin that will let you easily include svg octicons in your jekyll sites.

## Install
Expand Down
1 change: 0 additions & 1 deletion docs/content/packages/rails.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ source: 'https://github.com/primer/octicons/tree/master/lib/octicons_helper'

[![Gem version](https://img.shields.io/gem/v/octicons_helper.svg)](https://rubygems.org/gems/octicons_helper)


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

## Install
Expand Down
124 changes: 23 additions & 101 deletions docs/content/packages/react.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: React
status: Stable
status: Stable
colebemis marked this conversation as resolved.
Show resolved Hide resolved
source: 'https://github.com/primer/octicons/tree/master/lib/octicons_react'
---

Expand All @@ -14,117 +14,52 @@ npm install @primer/octicons-react

## Usage

### `<Octicon>`
The `<Octicon>` component is really just the "shell" of an Octicon that renders
the `<svg>` element and all of its attributes. To render a specific icon, you
must pass it either via the `icon` prop, or as the only child:

```jsx
/**
* The prop form is shorter, but doesn't allow you to pass icon props.
*/
<Octicon icon={Icon} />

/**
* The child form allows you to pass props.
*/
<Octicon><Icon x={10}/></Octicon>
```

Note that none of our builtin icons take props, so unless you're creating
[custom icons](#custom-icons) you'll probably want to use the `icon` prop form.

### Icons
The `@primer/octicons-react` module exports the `Octicon` component as
`default` and the individual icon symbols as separate [named
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 Octicon, {Beaker, Zap} from '@primer/octicons-react'
import {BeakerIcon, ZapIcon} from '@primer/octicons-react'

export default function Icon({boom}) {
return <Octicon icon={boom ? Zap : Beaker}/>
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.

### All icons
If you don't mind your bundle being huge or you need to be able to render
arbitrarily named icons at runtime, you can import either of the following
named exports:

#### `getIconByName()`
The `getIconByName` export is a function that takes a lowercase octicon name
(such as `arrow-right`) and returns the corresponding icon class. Using this
helper, it's possible to create an Octicon class that takes a `name` prop and
resolves it to the right component:

```jsx
import React from 'react'
import Octicon, {getIconByName} from '@primer/octicons-react'

export default function OcticonByName({name, ...props}) {
return <Octicon {...props} icon={getIconByName(name)} />
}
```

#### `iconsByName`
The `iconsByName` export is an object that maps keys (such as `arrow-right` or
`zap`) to component functions, which you can use to generate listings of all
the octicons:

```jsx
import React from 'react'
import Octicon, {iconsByName} from '@primer/octicons-react'

export default function OcticonsList() {
return (
<ul>
{Object.keys(iconsByName).map(key => (
<li key={key}>
<tt>{key}</tt>
<Octicon icon={iconsByName[key]}/>
</li>
))}
</ul>
)
}
```

### 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 Octicon, {Repo} from '@primer/octicons-react'
import {RepoIcon} from '@primer/octicons-react'

export default () => (
<h1>
<Octicon icon={Repo} size='large' verticalAlign='middle' /> github/github
<RepoIcon verticalAlign='middle' /> github/github
</h1>
)
```


### `ariaLabel`
### `aria-label`
You have the option of adding accessibility information to the icon with the
[`aria-label` attribute][aria-label] via the `ariaLabel` prop (note the
capitalization of `L`!).
[`aria-label` attribute][aria-label] via the `aria-label` prop.

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

export default () => (
<button>
<Octicon icon={Plus} ariaLabel="Add new item" /> New
<PlusIcon aria-label="Add new item" /> New
</button>
)
```
Expand All @@ -142,44 +77,31 @@ render octicons at standard sizes:

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

export default () => (
<h1>
<a href='https://github.com'>
<Octicon icon={LogoGithub} size='large' ariaLabel='GitHub'/>
<LogoGithubIcon size='large' aria-label='GitHub'/>
</a>
</h1>
)
```

### `Octicon` (DEPRECATED)

## Custom icons
Each of our icon components is really just a function that renders its SVG
`<path>`. To accommodate icons varying aspect ratios, the `Octicon` component
determines the `viewBox` of the `<svg>` element by first looking for a `size`
array on the icon component class. For instance, if you wanted to create a
custom icon that consisted of three circles side by side, you could do this:

```jsx
import React from 'react'
import Octicon from '@primer/octicons-react'

function CirclesIcon() {
return (
<React.Fragment>
<circle r={5} cx={5} cy={5}/>
<circle r={5} cx={15} cy={5}/>
<circle r={5} cx={25} cy={5}/>
</React.Fragment>
)
}
> ⚠️ The `Octicon` component is deprecated. Use icon components on their own instead:
> ```diff
- <Octicon icon={AlertIcon} />
+ <AlertIcon />
```

CirclesIcon.size = [30, 10]
The `Octicon` component is wrapper that passes props to its icon component. To render a specific icon, you
can pass it either via the `icon` prop, or as the only child:

export default CirclesOcticon(props) {
return <Octicon {...props} icon={CirclesIcon} />
}
```jsx
<Octicon icon={Icon} />
<Octicon><Icon x={10}/></Octicon>
```

[octicons]: https://octicons.github.com/
Expand Down
Loading