> For the complete documentation index, see [llms.txt](https://docs.digit.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digit.org/platform/guides/developer-guide/ui-developer-guide/digit-ui-components0.2.0/molecule/side-nav.md).

# Side Nav

The Side Nav component acts as the primary navigation pattern, helping users access modules, submodules, and utilities in a compact, vertically stacked structure. Designed for both accessibility and scalability, it accommodates icons, labels, tree structures, and persistent actions, ensuring a consistent experience across municipal and citizen-facing interfaces.

<figure><img src="/files/v3hjWPwzzpAeVEuRrcqF" alt=""><figcaption></figcaption></figure>

{% tabs %}
{% tab title="Component React" %}

```
// Sample code

 <SideNav
    items={[
      {
        icon: {
          icon: 'Home'
        },
        label: 'Home'
      },
      {
        children: [
          {
            icon: {
              icon: 'Work'
            },
            label: 'SubModule 1',
            path: '/'
          },
          {
            icon: {
              icon: 'Person'
            },
            label: 'SubModule 2',
            path: '/'
          }
        ],
        icon: {
          icon: 'ChatBubble'
        },
        label: 'Module 1'
      },
      {
        children: [
          {
            children: [
              {
                icon: {
                  icon: 'LabelImportant'
                },
                label: 'InnerModule 1',
                path: '/'
              },
              {
                icon: {
                  icon: 'Lock'
                },
                label: 'InnerModule 2',
                path: '/'
              }
            ],
            icon: {
              icon: 'Info'
            },
            label: 'SubModule 1',
            path: '/'
          },
          {
            icon: {
              icon: 'Accessibility'
            },
            label: 'SubModule 2',
            path: '/'
          }
        ],
        icon: {
          icon: 'CheckCircle'
        },
        label: 'Module 2'
      },
      {
        icon: {
          icon: 'Delete'
        },
        label: 'Module 3'
      },
      {
        icon: {
          icon: 'DriveFileMove'
        },
        label: 'Module 4'
      },
      {
        icon: {
          icon: 'Label'
        },
        label: 'Module 5'
      },
      {
        icon: {
          icon: 'Lightbulb'
        },
        label: 'Module 6'
      }
    ]}
    onBottomItemClick={function noRefCheck(){}}
    onSelect={function noRefCheck(){}}
    transitionDuration={0.5}
  />
```

{% endtab %}

{% tab title="Component Flutter" %}

```
// Sample code

SideNavBar(
          enableSearch: true,
          bottomActions: bottomActions,
          type: SideNavType.light,
          navItems: [
            NavItem(
                icon: Icons.home_outlined,
                title: 'Home',
                selectedIcon: Icons.home_filled),
            NavItem(
                icon: Icons.person_outline,
                title: 'Profile',
                selectedIcon: Icons.person,
                children: [
                  NavItem(icon: Icons.person, title: 'profile1', children: [
                    NavItem(icon: Icons.person_outline, title: 'logout', selectedIcon: Icons.person),
                    NavItem(icon: Icons.person_outline, title: 'save', selectedIcon: Icons.person),
                  ]),
                  NavItem(icon: Icons.settings, title: 'profile2', children: [
                    NavItem(icon: Icons.person_outline, title: 'logout', selectedIcon: Icons.person),
                    NavItem(icon: Icons.person_outline, title: 'save', selectedIcon: Icons.person),
                  ]),
                ]),
            NavItem(
                icon: Icons.settings_outlined,
                title: 'Settings',
                selectedIcon: Icons.settings,
                children: [
                  NavItem(icon: Icons.person_outline, title: 'language', selectedIcon: Icons.person),
                  NavItem(icon: Icons.person_outline, title: 'theme', selectedIcon: Icons.person),
                ]),
            // Add more items here
          ],
        );
```

{% endtab %}

{% tab title="Component Design" %}

{% endtab %}
{% endtabs %}

## Anatomy

<figure><img src="/files/wVnF3ZK4U9Yt2Hcz0piU" alt=""><figcaption></figcaption></figure>

## Variants

***

<table data-header-hidden><thead><tr><th width="321"></th><th></th></tr></thead><tbody><tr><td><div><figure><img src="/files/6Zo2KmaoBji22TqdVl5W" alt=""><figcaption></figcaption></figure></div></td><td><p><strong>Light</strong></p><p>Ideal for interfaces with brighter UIs, ensuring visual consistency and high contrast with dark icons and text.</p></td></tr><tr><td><div><figure><img src="/files/50bvxks4AWfVlCzOMhNf" alt=""><figcaption></figcaption></figure></div></td><td><strong>Dark</strong><br>Best suited for dashboards or applications requiring reduced eye strain or a focused visual hierarchy.</td></tr></tbody></table>

## Properties

<table data-header-hidden data-full-width="false"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>Enable Search</strong><br>Provides a quick-filtering input field at the top of the side nav, enabling users to locate modules and nested items efficiently. Particularly helpful in apps with deep or large information architectures.<br></td><td><img src="/files/avLIPEFX6HoV42jwFAfg" alt=""></td></tr><tr><td><strong>Universal Action</strong><br>Includes persistent utilities like Help, Settings, and Logout; these remain accessible regardless of scroll or nav state, improving usability.</td><td><img src="/files/VLWAU28asTlWAmv6VhUe" alt=""></td></tr><tr><td><strong>Tree Selection for Children</strong><br>Supports hierarchical navigation by displaying submodules or inner navigation when parent items are expanded. Allows users to interact with nested items.</td><td><div><figure><img src="/files/ZoR7W3EQSyQ8hWGOnZdt" alt=""><figcaption></figcaption></figure></div></td></tr></tbody></table>

## Property Configuration Table

Each design component offers a range of configurable options. These options are intentionally platform-agnostic, allowing implementations to adapt and tailor them to align with the specific requirements of the chosen framework.

{% tabs %}
{% tab title="React" %}

<table><thead><tr><th width="257">Property</th><th>Value</th><th>Default</th></tr></thead><tbody><tr><td>items</td><td>text</td><td>-</td></tr><tr><td>theme</td><td>text</td><td>-</td></tr><tr><td>variant</td><td>yes/no</td><td>no</td></tr><tr><td>collapsedWidth</td><td>yes/no</td><td>no</td></tr><tr><td>expandedWidth</td><td>number</td><td>-</td></tr><tr><td>transitionDuration</td><td>yes/no</td><td>-</td></tr><tr><td>styles</td><td>yes/no</td><td>no</td></tr><tr><td>hideAccessbilityTools</td><td>yes/no</td><td>no</td></tr><tr><td>enableSearch</td><td>yes/no</td><td>no</td></tr><tr><td>onSelect</td><td>yes/no</td><td>no</td></tr><tr><td>onBottomItemClick</td><td>number</td><td>no</td></tr><tr><td>className</td><td>yes/no</td><td>no</td></tr></tbody></table>
{% endtab %}

{% tab title="Flutter" %}

<table><thead><tr><th>Property</th><th width="209">Value</th><th>Default</th></tr></thead><tbody><tr><td>type</td><td>SideNavType</td><td>SideNavType.dark</td></tr><tr><td>navItems</td><td>List&#x3C;NavItem></td><td>-</td></tr><tr><td>enableSearch</td><td>bool</td><td>false</td></tr><tr><td>bottomActions</td><td>bool</td><td>false</td></tr></tbody></table>
{% endtab %}
{% endtabs %}

## Usage Guide

***

| <div><figure><img src="/files/6BXQbGf5ZQpQSZBl5QFX" alt=""><figcaption></figcaption></figure></div> | <p><strong>Hierarchical Structure</strong></p><p>Enable tree selection for complex apps where submodules need to be grouped contextually.  Don’t flatten deep hierarchies if users need to frequently access child modules—it hinders navigation efficiency.</p> |
| --------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <div><figure><img src="/files/1YaJ8QyfwMTR8HR7BGlv" alt=""><figcaption></figcaption></figure></div> |                                                                                                                                                                                                                                                                  |

## Change log

***

| Date         | Number  | Notes                                                                                           |
| ------------ | ------- | ----------------------------------------------------------------------------------------------- |
| Dec 15, 2024 | v-0.0.2 | <p>This component is added to the website.<br>This component is now individually versioned.</p> |

## Design Checklist

***

<table data-header-hidden><thead><tr><th width="129" data-type="checkbox"></th><th></th></tr></thead><tbody><tr><td>true</td><td><strong>All interactive states</strong> - Includes all interactive states that are applicable (hover, down, focus, keyboard focus, disabled).</td></tr><tr><td>true</td><td><strong>Accessible use of colours</strong> - Colour is not used as the only visual means of conveying information (WCAG 2.1 1.4.1)</td></tr><tr><td>true</td><td><strong>Accessible contrast for text</strong> - Text has a contrast ratio of at least 4.5:1 for small text and at least 3:1 for large text (WCAG 2.0 1.4.3).</td></tr><tr><td>true</td><td><strong>Accessible contrast for UI components</strong> - Visual information required to identify components and states (except inactive components) has a contrast ratio of at least 3:1 (WCAG 2.1 1.4.11).</td></tr><tr><td>true</td><td><strong>Keyboard interactions</strong> - Includes all interactive states that are applicable (hover, down, focus, keyboard focus, disabled).</td></tr><tr><td>false</td><td><strong>Screen reader accessible</strong> - All content, including headings, labels, and descriptions, is meaningful, concise, contextual and accessible by screen readers.</td></tr><tr><td>true</td><td><strong>Responsive for all breakpoints</strong> - Responsiveness for 3 breakpoints - Mobile, Tablet and Desktop</td></tr><tr><td>true</td><td><strong>Usage guidelines</strong> - Includes a list of dos and don'ts that highlight best practices and common mistakes.</td></tr><tr><td>false</td><td><strong>Content guidelines</strong> - Content standards and usage guidelines for writing and formatting in-product content for the component.</td></tr><tr><td>true</td><td><strong>Defined variants and properties</strong> - Includes relevant variants and properties (style, size, orientation, optional iconography, decorative elements, selection states, error states, etc.)</td></tr><tr><td>true</td><td><strong>Defined behaviours</strong> - Guidelines for keyboard navigation and focus, layout management (including wrapping, truncation, and overflow), animations, and user interactions.</td></tr><tr><td>true</td><td><strong>Design Kit</strong> - Access to the design file for the component in Figma, multiple options, states, colour themes, and platform scales.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.digit.org/platform/guides/developer-guide/ui-developer-guide/digit-ui-components0.2.0/molecule/side-nav.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.
