Agriculture Design System
Beta
Design System for the Export Service

Tabs

Tabs are used to categorise content into seperate views. A user can navigate between each section of content, displaying one section at a time.

View in FigmaView in StorybookView in Github
import { ... } from '@ag.ds-next/react/tabs';

Usage

Tabs components can be imported via the tabs entrypoint in the @ag.ds-next/react package.

For example:

import { ... } from '@ag.ds-next/react/tabs';

Props

Tabs Props
PropTypeDescription
activeIndex?number
The index of the active tab.
background?"body" | "bodyAlt"Default: "body"
If this component is placed on a page with a `bodyAlt` background, set this to `bodyAlt`.
children?ReactNode
contained?booleanDefault: true
If `false`, the horizontal padding and borders will be removed.
onChange?((activeIndex: number) => void)
Function to be called when the active tab index is changed.
TabList Props
PropTypeDescription
children?ReactNode
TabButton Props
PropTypeDescription
children?ReactNode
endElement?ReactNode
TabPanels Props
PropTypeDescription
children?ReactNode
TabPanel Props
PropTypeDescription
children?ReactNode

Source

You can view the full source code for this package on Github.