# Tabs

A simple tabs component.

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

```jsx
import { useState } from 'react'
import { Tabs } from '@aragon/ui'

const App = () => {
  const [selected, setSelected] = useState(0)
  return (
    <Tabs
      items={['Orange', 'Pear', 'Cherry']}
      selected={selected}
      onChange={setSelected}
    />
  )
}
```

## Demonstration

![](/files/jhlk815ofithSVwU9dgF)

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

#### `items` (required) <a href="#items-required" id="items-required"></a>

* Type: `Array` of React nodes

The items that are going to be displayed in every tab.

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

* Type: `Number`
* Default: `0`

The currently selected tab, using its index.

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

* Type: `Function`

When a tab is selected, this function gets called with the index of the tab as a parameter.


---

# 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/tabs.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.
