componentes
tabs
Esse conjunto de componentes representa uma navegação por guias.
índice
demo interativa
Uma versão de interativa do componente desenvolvido.
With React Router
import { Route, Link, Redirect, Switch } from 'react-router-dom';
import { useRouteMatchTab } from '@olist/ui-commons/hooks';
const tabKeys = {
  home: `home`,
  orders: `orders`,
};
const basename = '/products';
const routes = {
  basename,
  home: `${basename}/home`,
  orders: `${basename}/orders`,
};
const matchTab = useRouteMatchTab(routes.home, [
  {
    path: routes.home,
    tabKey: tabKeys.home,
  },
  {
    path: routes.orders,
    tabKey: tabKeys.orders,
  },
]);
return (
  <TabsProvider currentTab={matchTab.tabKey}>
    <TabsMenu aria-label="Main tabs">
      <Tab as={Link} to={routes.home} tabKey={tabKeys.home}>
        home
      </Tab>
      <Tab as={Link} to={routes.orders} tabKey={tabKeys.orders}>
        orders
      </Tab>
    </TabsMenu>
    <Switch>
      <Route path={routes.home}>
        <TabsPanel tabKey={tabKeys.home}>home</TabsPanel>
      </Route>
      <Route path={routes.orders}>
        <TabsPanel tabKey={tabKeys.orders}>orde</TabsPanel>
      </Route>
      <Route path={routes.basename}>
        <Redirect to={routes.home} />
      </Route>
    </Switch>
  </TabsProvider>
);guia de design
- Tem guia de uso.
 - Tem guia de conteúdo.
 - Use os design tokens.
 - Tem símbolo no Figma.
 - Possui motion.
 
- Possui versão web.
 - Possui versão responsiva.
 - Possui versão mobile.
 - É acessível via leitor de tela.
 - Texto possui contraste acessível (WCAG 2.0 - Nível AA).
 
conteúdo relacionado
Migração do United para Olist Design System
Propriedades
| United (TabsProviderV2) | Olist Design System (TabsProvider) | 
|---|---|
| children | children | 
| currentTab | currentTab | 
| onChangeTab | onChange | 
| United (TabsMenusV2) | Olist Design System (TabsMenu) | 
|---|---|
| children | children | 
| United (TabsPanelV2) | Olist Design System (TabsPanel) | 
|---|---|
| children | children | 
| tabKey | tabKey | 
| United (Tab) | Olist Design System (Tab) | 
|---|---|
| children | children | 
| setFocusedTabIndex | setFocusedTabIndex | 
| onClick | onClick | 
| tabKey | tabKey |