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

# simple

> Default mapping between InstantSearch state and the URL.

<Note>
  You are viewing the documentation for **InstantSearch.js v4**.
  To upgrade from v3, see the [migration guide](/doc/guides/building-search-ui/upgrade-guides/js#upgrade-from-v3-to-v4).
  Looking for the v3 version of this page?
  [View the v3 docs](https://algolia.com/old-docs/deprecated/instantsearch/js/v3/api-reference/simple-state-mapping).
</Note>

```js Signature theme={"system"}
const routing = {
  stateMapping: simple(),
};
```

## Import

<CodeGroup>
  ```js Package manager theme={"system"}
  import { simple } from "instantsearch.js/es/lib/stateMappings";
  ```

  ```js CDN theme={"system"}
  const { simple } = instantsearch.stateMappings;
  // or directly use instantsearch.stateMappings.simple()
  ```
</CodeGroup>

## About this widget

This `simple` state mapping is the default for the `instantsearch` object's
[routing](/doc/api-reference/widgets/instantsearch/js#param-routing) option.

The router provides an API that lets you customize some of its behaviors.
To get a sense of what you can do with the API,
see [Routing URLs](/doc/guides/building-search-ui/going-further/routing-urls/js).

The only transformation applied by the function is the omission of `configure`.

```js JavaScript icon=code theme={"system"}
simple().stateToRoute({
  instant_search: {
    query: "Apple",
    page: 5,
    configure: {
      hitsPerPage: 4,
    },
  },
});

// gives as output:
// {
//   instant_search: {
//     query: 'Apple',
//     page: 5,
//   },
// }
```

## Examples

```js JavaScript icon=code theme={"system"}
instantsearch({
  // ...
  routing: {
    stateMapping: simple(),
  },
});
```
