# GitHub Octicons
[![npm version](https://img.shields.io/npm/v/octicons.svg)](https://www.npmjs.org/package/octicons)
[![Build Status](https://travis-ci.org/primer/octicons.svg?branch=master)](https://travis-ci.org/primer/octicons)
> Octicons are a scalable set of icons handcrafted with <3 by GitHub.
## Install
**NOTE:** The compiled files are located in `build/`. This directory is located in the published npm package. Which means you can access it when you `npm install octicons`. You can also build this directory by following the [building octicons directions](#building-octicons). The files in the `lib/` directory are the raw source files and are not compiled or optimized.
#### npm
This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `octicons` with this command.
```
$ npm install octicons --save
```
## Usage
For all the usages, we recommend using the CSS located in `build/octicons.css`. This is some simple CSS to normalize the icons and inherit colors.
### Spritesheet
With an [SVG sprite icon system](https://css-tricks.com/svg-sprites-use-better-icon-fonts/) you can include the sprite sheet located `build/sprite.octicons.svg` after you [build the icons](#building-octicons) or from the npm package. There is a demo of how to use the spritesheet in the `build/` directory also.
### Node
After installing `npm install octicons` you can access the icons like this.
```js
var octicons = require("octicons")
octicons.alert
// { keywords: [ 'warning', 'triangle', 'exclamation', 'point' ],
// path: '',
// 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] }
```
There will be a key for every icon, with [`toSVG`](#octiconsalerttosvg) and other properties.
#### `octicons.alert.symbol`
Returns the string of the symbol name, same as the key for that icon.
```js
octicons.x.symbol
// "x"
```
#### `octicons.person.path`
Returns the string representation of the path of the icon.
```js
octicons.x.path
//
```
#### `octicons.issue.options`
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.alert.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.alert.height`
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._
#### `keywords`
Returns an array of keywords for the icon. The data [comes from `lib/data.json`](https://github.com/primer/octicons/blob/master/lib/data.json). Consider contributing more aliases for the icons.
```js
octicons.x.keywords
// ["remove", "close", "delete"]
```
#### `octicons.alert.toSVG()`
Returns a string of the `