> For the complete documentation index, see [llms.txt](https://voit.gitbook.io/voitdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://voit.gitbook.io/voitdocs/components/index-bar.md).

# Index Bar

Index bars provide a quick navigation method, allowing users to jump to specific sections or items in a list, such as alphabetically sorted content. They enhance usability by improving accessibility.

<figure><img src="https://1456965416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOHrijNlCiWxhWuZ7eBdg%2Fuploads%2FArtPbrYmyp7fsgrgIdRV%2FFrame%2046.png?alt=media&amp;token=701e851d-b0b7-4ad4-8ceb-19f31f00b012" alt="" width="330"><figcaption></figcaption></figure>

## Overview

With an index bar, users can easily locate items in long, sorted lists (alphabetically or numerically) without relying on traditional search or filter methods.

{% embed url="<https://www.figma.com/design/4NwKhd4dwRhRF5Zpiooi69/Components?node-id=2-221984&t=0Thv0LIO2gFzE3eo-4>" %}

## When to use

* Use when users need to move through large collections of alphabetically or numerically sorted items, such as a contact list or product inventory.&#x20;
* Ideal for scenarios where content is divided into sections by a specific order (e.g., alphabetical or chronological) and users need quick access to these sections.&#x20;
* Use when users need to quickly navigate between distant items in a list without needing to scroll manually through all intermediate entries.&#x20;
* Use in mobile and tablet applications where space is limited but users still need an intuitive way to scroll and navigate large datasets.

## When not to use

* Avoid using index bars when the list contains only a few items as a simple scroll or search may be more efficient.&#x20;
* Index bars should not be used for unstructured content or datasets that lack a clear ordering system.&#x20;
* Index bars are not suitable when users need to perform complex searches or filtering operations, as it only aids in quick navigation to predefined sections.&#x20;
* Avoid using index bars when the content doesn't logically fit into alphabetic or numeric categories (e.g., unordered content, thematic categories).

## Types

<figure><img src="https://1456965416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOHrijNlCiWxhWuZ7eBdg%2Fuploads%2FNkhastgVwsPZCOqZq0QQ%2FVariants.png?alt=media&amp;token=acd855cf-72be-4df6-bfdb-3769ac6caee1" alt=""><figcaption></figcaption></figure>

## Anatomy

1. **Index Bar (Alphabetic or Numeric):** The interactive bar on the side of the list, displaying the alphabet or numbers for navigation.&#x20;
2. **Selected Index:** The specific index entry currently selected, visually distinct from unselected entries.

<figure><img src="https://1456965416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOHrijNlCiWxhWuZ7eBdg%2Fuploads%2FXaYcxpTdxC3uKgshhgtN%2FAnatomy.png?alt=media&amp;token=b287b340-3bba-478a-b244-b22c065cbe00" alt=""><figcaption></figcaption></figure>

## Interaction Behavior

* **Tap-to-Jump:** Users can tap directly on an index letter or number to immediately jump to the corresponding section of the list.&#x20;
* **Scroll-to-Drag:** Users should be able to drag their finger or mouse over the index to dynamically scroll through the list, providing a smooth transition between sections as they move.
* **Hover Behavior:** On desktop, hovering over the index can highlight the hovered letter or number, offering feedback on which section will be selected.&#x20;
* **Snap-to-Section:** When a user selects or scrolls to a specific index point, the list should “snap” to the beginning of that section, ensuring proper alignment and easy reading.&#x20;
* **Dynamic Highlighting:** As users scroll through the list manually, the corresponding index letter or number should be highlighted to provide feedback on the current section.&#x20;
* **Debouncing Selection:** If users scroll quickly through the index, implement a debounce mechanism to ensure the system doesn't try to load every section they scroll past. Instead, snap to the final selected section.

## Size

<figure><img src="https://1456965416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOHrijNlCiWxhWuZ7eBdg%2Fuploads%2Fj44sdmFcpUkf7QVRCYGs%2FSize.png?alt=media&amp;token=ae385615-65f5-4188-975b-7602b4a93522" alt=""><figcaption></figcaption></figure>

<table data-full-width="false"><thead><tr><th>Size</th><th>Text (px)</th></tr></thead><tbody><tr><td>Small</td><td>11</td></tr><tr><td>Medium</td><td>12</td></tr></tbody></table>

## Accessibility

* **Keyboard Accessibility:** Ensure users can navigate the index bar using arrow keys or shortcuts, enabling them to scroll through sections and jump to specific parts of the list using the keyboard.&#x20;
* **Screen Reader Compatibility:** For users with visual impairments, the index bar should announce the currently selected letter or number and provide clear feedback when sections are navigated.&#x20;
* **Visual and Tactile Feedback:** Provide clear visual feedback when a user selects an index letter or number (e.g., changing color) and ensure this feedback is accessible to those with low vision or color blindness.
* &#x20;**Support for Tap and Swipe Gestures:** For touch devices, ensure that users can tap on an index letter or number to jump to a section, and allow swiping or dragging gestures to scroll through the index smoothly.

## Example

* **Contacts List in a Phonebook App:** Use the index bar to navigate through a large set of contacts alphabetically, making it easier for users to jump to a specific letter group.&#x20;
* **Product Inventory in E-commerce:** Implement an index bar for large product catalogues where users can scroll through items grouped alphabetically or by category.&#x20;
* **Library Catalog:** Allow users to navigate alphabetically or numerically through large sets of books or resources in a digital library or educational application.&#x20;
* **Photo Galleries:** Alphabetical or numeric index bars can be used in large image galleries to quickly navigate through years or categories of photographs.
