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.
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
Prop | Type | Description |
---|---|---|
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. |
Prop | Type | Description |
---|---|---|
children? | ReactNode |
Prop | Type | Description |
---|---|---|
children? | ReactNode | |
endElement? | ReactNode |
Prop | Type | Description |
---|---|---|
children? | ReactNode |
Prop | Type | Description |
---|---|---|
children? | ReactNode |
Source
You can view the full source code for this package on Github.