Tabs

The Tabs component provides a way to navigate between different views in the same context.

import { TabBar } from "@ds-kit/tabs"

Basic Example

<TabBar items={[{ key: 0, label: "Item 1" }, { key: 1, label: "Item 2" }]} />

RenderProps Example wrapping Tab with a tag

<TabBar
  items={[
    {
      key: 0,
      label: "Item 1",
      tabProps: {
        as: "a",
        href: "https://ds-kit.herokuapp.com/packages/tabs/",
      },
      render: d => <strong>{d.label}</strong>,
    },
    {
      key: 1,
      label: "Item 2",
      tabProps: {
        as: "a",
        href: "https://ds-kit.herokuapp.com/packages/tabs/",
      },
    },
  ]}
/>

TabBar props

Name
Type
Default
selected
number
0
items
array
onChange
func
sideOffset
number
48
tabProps
object
{}
borderColor
string
"grey.100"
activeColor
string
"primary"
activeTextColor
string
"inherit"
color
string
"inherit"
height
stringarray
"2.5rem"
render
node
scrollBehavior
string
"smooth"