Note: Github Octicons has switched from providing an icon font to being a library for generating SVG markup for string templating engines, so this component uses the last version which provided an icon font, version 4.
As such, the available icons and their appearance may not match with what's on the Github Octicons documentation site.
Note: Webpack is required in order to use this component.
Install and use the Octicon component like so:
npm install --save react-octicon
let <div><Octicon mega spin name="sync"/></div>
Usage with nwb
If you use nwb to build and serve the React app you're using this component in, it will automatically configure Webpack to handle CSS, image and font dependencies for you.
Usage with Webpack
This component handles the Octicons CSS dependency for you, but you must use Webpack and configure it to handle CSS and associated font and image files.
For example, using the following webpack loaders:
npm install --save-dev css-loader file-loader style-loader
module:rules:test: /\.css$/use:'style-loader''css-loader'test: /\.$/use: 'file-loader'
See Webpack's Loading CSS documentation for more info.
||The name of an icon in the Octicons set, e.g.
||An additional class name for the element rendered by the component|
Any additional props given, such as event handlers or
aria-* attributes, will be passed to the element rendered by the component.