Use package octicons instead of including icons.tsx
See original GitHub issuehttps://www.npmjs.com/package/octicons
Import as plain text:
import doma from 'doma';
import alertIcon from 'octicons/build/svg/alert.svg';
document.body.append(doma.one(alertIcon))
Or as JSX with https://github.com/janjakubnanista/svg-jsx-loader
import alert from 'octicons/build/svg/alert.svg';
document.body.append(alert());
There’s also the official @githubprimer/octicons-react
package but I don’t think it’s being built+published correctly yet.
Also possibly: https://github.com/siddharthkp/jsxo but it needs Babel
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Use package octicons instead of including icons.tsx · Issue #1752 ...
Successfully merging a pull request may close this issue. Use @primer/octicons package instead of curating icons.tsx refined-github/refined-github.
Read more >Use package octicons instead of including icons.tsx #1752 - Issuehunt
Use package octicons instead of including icons.tsx #1752 ... import doma from 'doma'; import alertIcon from 'octicons/build/svg/alert.svg'; ...
Read more >How to Use SVG Icons in React with React Icons and Font ...
We're first going to walk through using a package called react-icons that will allow us to easily import icons from popular icon sets...
Read more >extended-react-icons - npm
Include popular icons in your React projects easly with react-icons , which utilizes ES6 imports that allows you to include only the icons...
Read more >JavaScript | Octicons - Primer Design System
This package is distributed with npm. After installing npm, you can ... Instead, use bracket notation (e.g. octicons['arrow-right'] ).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sadly they use too much React stuff in there, it’s bloated for us
@bfred-it Seems like https://www.npmjs.com/package/@githubprimer/octicons-react is being published regularly now. Probably we can use it. What do you think?