@reach-ui-fork/tabs
v0.18.1
Published
Accessible React Tabs Component
Downloads
2,743
Readme
@reach-ui-fork/tabs
An accessible tabs component.
The Tab
and TabPanel
elements are associated by their order in the tree. None of the components are empty wrappers, each is associated with a real DOM element in the document, giving you maximum control over styling and composition.
You can render any other elements you want inside of Tabs
, but TabList
should only render Tab
elements, and TabPanels
should only render TabPanel
elements.
import { Tabs, TabList, Tab, TabPanels, TabPanel } from "@reach-ui-fork/tabs";
import "@reach-ui-fork/tabs/styles.css";
function Example() {
return (
<Tabs>
<TabList>
<Tab>One</Tab>
<Tab>Two</Tab>
<Tab>Three</Tab>
</TabList>
<TabPanels>
<TabPanel>
<p>one!</p>
</TabPanel>
<TabPanel>
<p>two!</p>
</TabPanel>
<TabPanel>
<p>three!</p>
</TabPanel>
</TabPanels>
</Tabs>
);
}