> For the complete documentation index, see [llms.txt](https://ignitus-docs.gitbook.io/side-navigation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ignitus-docs.gitbook.io/side-navigation/overview/usage.md).

# Usage

## Getting Started  [​<img src="https://emojis.slackmojis.com/emojis/images/1531847273/4225/blob-beers.gif?1531847273" alt="blob beers hangouts blob" data-size="line">](https://slackmojis.com/emojis/4225-blob-beers/download)

![](/files/-M7X3cquAUOGkJ_wPM7g)

### Installation

Using NPM

```
$ npm install side-navigation-react
```

{% hint style="info" %}
Before installing please have a look at its [peerDependencies](https://github.com/Ignitus/Ignitus-sideNavigation/blob/master/package.json#L62).
{% endhint %}

Once you're ready please go through the component usage.

```bash
import React from 'react';
import { BrowserRouter as Router } from  'react-router-dom';
import {
  Container,
  Content,
  SideNavigation
} from 'react-side-navigation';

export default () => (
  <Router>
    <Container>
      <SideNavigation navItems={navItems} />

      <Content>
        {/* put your content here. */}
        <Route path="/interface/buttons" component={interfaceButttons} />
        <Route
          path="/interface/typography"
          component={interfaceTypography}
        />
      </Content>
    </Container>
  </Router>
);
```

Architecture of **navItems**.

```bash
const navItems = [
  {
    title: 'Item 1',
    children: [
      {
        title: 'Item 1.1',
        route: '/foo',
      },
      {
        title: 'Item 1.2',
        route: '/bar',
      }
    ],
  },
  {
    title: 'Item 2',
    children: [
      {
        title: 'Item 2.1',
        children: [
          {
            title: 'Item 2.1.1',
            route: '/baz',
          }
        ],
      },
    ],
  }
];
```

`<SideNavigation>` can be customised by passing following properties.&#x20;

```bash
<SideNavigation
  heading={{
    title: 'Home',
    route: '/home',
  }}
  navItems={navItems}
  navBackground=""
  theme={{
    homeLinkColor: '',
    listItemHeadingColor: '',
    listItemHeadingArrowColor: '',
    subListItemTextColor: '',
    subListItemHeadingColor: '',
    subListItemHeadingArrowColor: '',
    hover: {
      subListItemBackgroundOnHover: '',
      subListItemColorOnHover: '',
    },
  }}
/>
```

{% hint style="info" %}
All props are optional and acquire default values except `navItems`.
{% endhint %}

Fonts used in the `<SideNavigation>` can also be customised by passing **fontFace** property.

```bash
<Container
  fontFace={{
    name: `'Open Sans', sans-serif`,
    url: 'https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400&display=swap',
  }}
>
</Container>
```
