# Pagination

A component to navigate through paginated content.

## Usage <a href="#usage" id="usage"></a>

```jsx
import { Box, Main, Pagination } from '@aragon/ui'

function App() {
  const [selected, setSelected] = useState(0)
  return (
    <Main>
      <Box>
        <Pagination pages={20} selected={selected} onChange={setSelected} />
      </Box>
    </Main>
  )
}
```

## Demonstration

![](/files/VqexCSeq8E0HkRqb4giF)

## Props <a href="#props" id="props"></a>

#### `onChange` <a href="#onchange" id="onchange"></a>

| TYPE                              | DEFAULT VALUE |
| --------------------------------- | ------------- |
| `Function`: `(item: Number) -> *` | None          |

Gets called when the selected page changes. Takes the new index as a unique parameter.

#### `pages` <a href="#pages" id="pages"></a>

| TYPE     | DEFAULT VALUE |
| -------- | ------------- |
| `Number` | `0`           |

The total amount of pages.

#### `selected` <a href="#selected" id="selected"></a>

| TYPE     | DEFAULT VALUE |
| -------- | ------------- |
| `Number` | `0`           |

The currently selected page (zero based numbering).

#### `touchMode` <a href="#touchmode" id="touchmode"></a>

| TYPE      | DEFAULT VALUE |
| --------- | ------------- |
| `Boolean` | `false`       |

When `true`, adapts the component to touch screens by making the targets bigge


---

# 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://legacy-docs.aragon.org/developers/tools/aragonui/navigation/pagination.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.
