# 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)

![](https://129387540-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7S6Q8cKe0WI34icFcZ%2F-M7WwC2rkKfZecBLG69B%2F-M7X3cquAUOGkJ_wPM7g%2Fside-nav-workflow.gif?alt=media\&token=c1f6370d-035c-43b3-9e66-4b9c6ab69704)

### 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>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ignitus-docs.gitbook.io/side-navigation/overview/usage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
