# Primer CSS Navigation [![NPM version](http://img.shields.io/npm/v/primer-navigation.svg)](https://www.npmjs.org/package/primer-navigation) [![Build Status](https://travis-ci.org/primer/primer-css.svg?branch=master)](https://travis-ci.org/primer/primer-css) > Primer comes with several navigation components. Some were designed with singular purposes, while others were design to be more flexible and appear quite frequently. This repository is a module of the full [primer-css][primer-css] repository. ## Install This repository is distributed with [npm][npm]. After [installing npm][install-npm], you can install `primer-navigation` with this command. ``` $ npm install --save primer-navigation ``` ## Usage The source files included are written in [Sass][sass] (`scss`) You can simply point your sass `include-path` at your `node_modules` directory and import it like this. ```scss @import "primer-navigation/index.scss"; ``` You can also import specific portions of the module by importing those partials from the `/lib/` folder. _Make sure you import any requirements along with the modules._ ## Build For a compiled **css** version of this module, a npm script is included that will output a css version to `build/build.css` The built css file is also included in the npm package. ``` $ npm run build ``` ## Documentation Primer comes with several navigation components. Some were designed with singular purposes, while others were design to be more flexible and appear quite frequently. {:toc} ## Menu The menu is a vertical list of navigational links. **A menu's width and placement must be set by you.** If you like, just use our grid columns as a parent. Otherwise, apply a custom `width`. ```html ``` There are a few subcomponents and add-ons that work well with the menu, including avatars, counters, and Octicons. ```html ``` You can also add optional headings to a menu. Feel free to use nearly any semantic element with the `.menu-heading` class, including inline elements, headings, and more. ```html ``` ## Tabnav When you need to toggle between different views, consider using a tabnav. It'll given you a left-aligned horizontal row of... tabs! ```html
``` Use `.float-right` to align additional elements in the `.tabnav`: ```html
Button
``` Additional bits of text and links can be styled for optimal placement with `.tabnav-extra`: ```html
Tabnav widget text here.
``` ```html
Tabnav extra link Tabnav extra link
``` ## Filter list A vertical list of filters. Grey text on white background. Selecting a filter from the list will fill its background with blue and make the text white. ```html ``` ## Sub navigation `.subnav` is navigation that is typically used when on a dashboard type interface with another set of navigation above it. This helps distinguish navigation hierarchy. ```html ``` You can have `subnav-search` in the subnav bar. ```html ``` You can also use a `subnav-search-context` to display search help in a select menu. ```html ``` ## License [MIT](./LICENSE) © [GitHub](https://github.com/) [primer-css]: https://github.com/primer/primer [docs]: http://primercss.io/ [npm]: https://www.npmjs.com/ [install-npm]: https://docs.npmjs.com/getting-started/installing-node [sass]: http://sass-lang.com/