💅 Enhancements
- Cache retrieval of Octicon SVG paths (#491)
💥 Breaking changes
- Fix 24px icon names #465 (@BenJetson
🙇 )unverifed-24.svg→unverified-24.svgfile-symlink-24.svg→file-symlink-file-24.svgfire-24.svg→flame-24.svgeye-slash-24.svg→eye-closed-24.svg
- Remove 24px
settingsicon. Usegearinstead #493
Assets
2
ashygee
released this
Assets
2
colebemis
released this
All packages
- We've given Octicons a new look
✨ Some icons have new names and some icons haven't been redesigned yet. The following table documents those changes. If you're using an octicon in v9.x that doesn't have an equivelent in v10.0 yet, let us know by opening an issue.
| v9.x | v10.0 | Notes |
|---|---|---|
arrow-small-down |
arrow-down |
|
arrow-small-left |
arrow-left |
|
arrow-small-right |
arrow-right |
|
arrow-small-up |
arrow-up |
|
circuit-board |
cpu |
|
cloud-download |
download |
|
cloud-upload |
upload |
|
dashboard |
meter |
|
dependent |
package-dependents |
|
file-pdf |
file |
|
file-symlink-directory |
file-submodule |
|
gist-secret |
lock |
|
gist |
code-square |
|
github-action |
play |
|
heart-outline |
heart |
|
internal-repo |
repo |
|
jersey |
people |
|
keyboard |
Request this icon | |
line-arrow-down |
arrow-down |
|
line-arrow-left |
arrow-left |
|
line-arrow-right |
arrow-right |
|
line-arrow-up |
arrow-up |
|
mail-read |
mail |
|
no-newline |
no-entry |
|
paintcan |
paintbrush |
|
plus-small |
plus |
|
primitive-dot-stroke |
dot |
|
primitive-dot |
dot-fill |
|
primitive-square |
square-fill |
|
radio-tower |
broadcast |
|
repo-force-push |
repo-push |
|
repo-template-private |
Request this icon | |
request-changes |
diff |
|
saved |
bookmark |
|
text-size |
heading or typography |
|
unsaved |
bookmark-slash |
|
watch |
hourglass |
|
workflow-all |
Request this icon |
- We designed a set of 24px icons—as well as 16px icons—to accommodate interfaces that need larger icons. All package implementations now choose which SVG to render based on the size passed in.
React (@primer/octicons-react)
-
Icon components (e.g.
AlertIcon,ArrowRightIcon, etc.) now acceptsize,ariaLabel,verticalAlign, andclassNameprops and can be used on their own. No need to pass them to theOcticoncomponent.<AlertIcon size={24} />
-
Icon components will now choose the best SVG icon to render based on the
sizepassed in. -
The
Octiconcomponent is deprecated. Use icon components on their own instead:- <Octicon icon={AlertIcon} /> + <AlertIcon />
BREAKING CHANGES 💥
-
All icon component names now include
Iconat the end (e.g.Alert→AlertIcon). -
In order to enable tree-shaking, we removed the
iconsByNameandgetIconByNameexports. -
Octiconno longer acceptswidthorheightprops. Use thesizeprop instead. In cases where the width and height of an icon are not equal (e.g. logos), the height will be set to the value of thesizeprop and thewidthwill be scaled proportionally. -
We renamed the
ariaLabelprop toaria-labelto be consistent with React: https://reactjs.org/docs/accessibility.html#wai-aria- <AlertIcon ariaLabel="alert"> + <AlertIcon aria-label="alert">
-
Setting
verticalAlign="top"on theOcticoncomponent or any icon component will now apply avertical-align: top;style to the<svg>. Previously, we were translating "top" to "text-top." So settingverticalAlign="top"would apply avertical-align: text-top;style to the<svg>. If you want a vertical alignment of "text-top," set theverticalAlignprop to"text-top". -
Custom icon components passed to the
Octiconcomponent now need to render the entire<svg>, not just the<path>.
function CirclesIcon() {
return (
- <React.Fragment>
+ <svg viewBox="0 0 30 10" width="30" height="10">
<circle r={5} cx={5} cy={5}/>
<circle r={5} cx={15} cy={5}/>
<circle r={5} cx={25} cy={5}/>
- </React.Fragment>
+ </svg>
)
}
- CirclesIcon.size = [30, 10]JavaScript (@primer/octicons)
BREAKING CHANGES 💥
- The structure of each icon object has been updated to allow support multiple SVGs per icon:
Before
octicons.alert
// {
// symbol: 'alert',
// keywords: ['warning', 'triangle', 'exclamation', 'point'],
// toSVG: [Function],
// width: 16,
// height: 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'
// },
// }After
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: ...
// }
// }
Assets
2
colebemis
released this
Features
- New icon
north-star#380
Assets
2
colebemis
released this
Features
- New icon
internal-repo#375
Assets
2
jonrohan
released this
Features
- New icons
heart-outlineinfinityline-arrow-upline-arrow-downline-arrow-rightline-arrow-left#365
Chores
- Contributing docs updates and issue template updates #367
Bugs
- Update
heartglyphs removing extra points #365
Assets
2
jonrohan
released this
Bugfix
- The workflow icon's viewport was incorrect causing the icon to be clipped.
Assets
2
jonrohan
released this
🚀 New Features
Assets
2
jonrohan
released this
🚀 New features
- New icons for save/unsave and primitive dot stroke #351 @ashygee @colinkeany
🧽 Chores
- Migrating to new yml actions syntax #332 @max & @jonrohan
- Update jekyll gemspec to support Jekyll 4.0 #347 @ntotten

