<g-octicon>
This is a custom element that renders SVG Octicons on your page at runtime.
Installation
If you're using npm, install it with:
npm i --save g-octicon
Otherwise, you can grab the browser bundle from:
https://unpkg.com/g-octicon
Usage
Add one or more <g-octicon>
elements to your HTML:
You can create <g-octicon>
elements in JavaScript, too:
const alert = documentalert // setting innerHTML will work, toodocumentinnerHTML = ` `
Attributes
The following attributes are observed, and will cause the icon to re-render when changed:
icon
is the name of the Octicon, e.g.alert
orbeaker
width
sets the width of the icon in pixels and scales the height proportionallyheight
sets the height of the icon in pixels and sets the width proportionally
You need only provide width
or height
. Providing both will produce unwanted vertical or horizontal whitespace around the icon.