TabList
Switches between views, and can drive React routes. `TabListNext` is the successor for universal code.
Health
Source
Design
Storybook
Playground
No Example
Accessibility
not-compliant
Platform
Web
Accessibility issues
The component misses an accessible representation of tabs. It misses to include the tab pannels content.
- Overview
- Props
- Figma
Use React router links
You can use the TabList to generate React router links.
In this case you don't have to take care about active state and onClick props, but only passing a NavLink component:
import { NavLink } from "react-router-dom";
function Playground() {
return (
<TabList
items={[
{
visual: "👋",
title: "Tab 1",
reactRouterElement: <Navlink to="/somewhere">
},
{
visual: "🤗",
title: "Tab 2",
reactRouterElement: <Navlink exact to="/somewhere/else">
},
]}
/>
);
}
Playground
Loading...
TabList props
| Name | Type | Default Value | Description | Usage count |
|---|---|---|---|---|
| addOn | ReactNode | |||
| bleeding | booleanundefined | false | Adds a wrapper to extend the tabs border | |
| bleedingOffset | numberSizeTokensundefined | $px40 | Define the width of the extend border | |
| items* | TabListItem[] | |||
| onPress | ((index: number) => void)undefined | () => {} | ||
| variant | Variantundefined | primary |