> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Index

> Scopes a group of widgets to a specific index in multi-index search interfaces.

<Note>
  This is the **React InstantSearch v7** documentation.
  If you're upgrading from v6, see the [upgrade guide](/doc/guides/building-search-ui/upgrade-guides/react/#migrate-from-react-instantsearch-v6-to-react-instantsearch-v7).
  If you were using React InstantSearch Hooks,
  this v7 documentation applies—just check for [necessary changes](/doc/guides/building-search-ui/upgrade-guides/react/#migrate-from-react-instantsearch-hooks-to-react-instantsearch-v7).
  To continue using v6, you can find the [archived documentation](https://algolia.com/old-docs/deprecated/instantsearch/react/v6/api-reference/instantsearch/).
</Note>

```tsx Signature theme={"system"}
<Index
  indexName={string}
  // Optional props
  indexId={string}
/>
```

## Import

```jsx JavaScript icon=code theme={"system"}
import { Index } from "react-instantsearch";
```

<Card title="See this widget in action" icon="monitor-play" href="https://instantsearchjs.netlify.app/stories/js/?path=/story/basics-index--default" horizontal>
  Preview this widget and its behavior.
</Card>

## About this widget

`<Index>` is the provider component for an Algolia index.

It's useful when building interfaces that target multiple indices such as [federated searches](/doc/guides/building-search-ui/ui-and-ux-patterns/multi-index-search/react).

The position of `<Index>` in the widget tree affects which search parameters apply.
Widgets that create search parameters forward them to their children `<Index>` widgets.

## Examples

```jsx JavaScript icon=code theme={"system"}
import React from "react";
import { liteClient as algoliasearch } from "algoliasearch/lite";
import { InstantSearch, Index } from "react-instantsearch";

const searchClient = algoliasearch("YourApplicationID", "YourSearchOnlyAPIKey");

function App() {
  return (
    <InstantSearch indexName="instant_search" searchClient={searchClient}>
      {/* Widgets */}
      <Index indexName="instant_search_demo_query_suggestions">
        {/* Widgets */}
      </Index>
    </InstantSearch>
  );
}
```

## Props

<ParamField body="indexName" type="string" required>
  The main index to search into.

  ```jsx JavaScript icon=code theme={"system"}
  <Index indexName="instant_search">{/* Widgets */}</Index>;
  ```
</ParamField>

<ParamField body="indexId" type="string">
  An identifier for the `<Index>` widget.

  Providing an `indexId` lets different `<Index` widgets target the same Algolia index.
  It's helpful for [`routing`](/doc/api-reference/widgets/instantsearch/react#param-routing).
  It lets you find the refinements that match an `<Index>` widget.

  ```jsx JavaScript icon=code theme={"system"}
  <Index
    // ...
    indexId="instant_search"
  >
    {/* Widgets */}
  </Index>;
  ```
</ParamField>
