Tabs
A simple tabs component.
Usage
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

Props
items (required)
items (required)Type:
Arrayof React nodes
The items that are going to be displayed in every tab.
selected
selectedType:
NumberDefault:
0
The currently selected tab, using its index.
onChange
onChangeType:
Function
When a tab is selected, this function gets called with the index of the tab as a parameter.
Last updated
Was this helpful?
