Overview
Create dynamic tabbed interfaces, as described in the WAI ARIA Authoring Practices. Tabs
is a higher-level component for quickly creating a Nav
matched with a set of TabPane
s.
Basic Tabs
Tabs with Icons
Small Tabs
To use smaller variants of tabs, add the .nav-tabs-sm
class.
Tabs with Content
No additional code is required to handle tabs with content.
API
Tabs
import Tabs from `@trimbleinc/modus-react-bootstrap/Tabs`
Name | Type | Default | Description |
---|---|---|---|
activeKey | string | number | controlled by: onSelect , initial prop: defaultActivekey Mark the Tab with a matching | |
defaultActiveKey | string | number | The default active key that is selected on start | |
id | string | HTML id attribute, required if no | |
mountOnEnter | boolean | false | Wait until the first "enter" transition to mount tabs (add them to the DOM) |
onSelect | function | controls activeKey Callback fired when a Tab is selected.
| |
transition | Transition | false | {Fade} | Sets a default animation strategy for all children |
unmountOnExit | boolean | false | Unmount tabs (remove it from the DOM) when it is no longer visible |
variant | 'tabs' | 'pills' | 'tabs' | Navigation style |
Tab
import Tab from `@trimbleinc/modus-react-bootstrap/Tab`
Name | Type | Default | Description |
---|---|---|---|
disabled | boolean | ||
eventKey | string | number | ||
tabClassName | string | ||
title required | node |
TabContainer
import TabContainer from `@trimbleinc/modus-react-bootstrap/TabContainer`
Name | Type | Default | Description |
---|---|---|---|
activeKey | string | number | controlled by: onSelect , initial prop: defaultActivekey The | |
defaultActiveKey | EventKey | ||
generateChildId | function | (eventKey, type) => `${props.id}-${type}-${eventKey}` | A function that takes an The |
id | string | HTML id attribute, required if no | |
mountOnEnter | boolean | Wait until the first "enter" transition to mount tabs (add them to the DOM) | |
onSelect | function | controls activeKey A callback fired when a tab is selected. | |
transition | {Transition | false} | {Fade} | Sets a default animation strategy for all children |
unmountOnExit | boolean | Unmount tabs (remove it from the DOM) when they are no longer visible |
TabContent
import TabContent from `@trimbleinc/modus-react-bootstrap/TabContent`
Name | Type | Default | Description |
---|---|---|---|
as | elementType | <div> | |
bsPrefix | string | 'tab-content' |
TabPane
import TabPane from `@trimbleinc/modus-react-bootstrap/TabPane`
Name | Type | Default | Description |
---|---|---|---|
active | boolean | Toggles the active state of the TabPane, this is generally controlled by a TabContainer. | |
aria-labelledby | string | ||
as | elementType | ||
eventKey | string | number | A key that associates the | |
id | string | ||
mountOnEnter | boolean | Wait until the first "enter" transition to mount the tab (add it to the DOM) | |
onEnter | function | Transition onEnter callback when animation is not | |
onEntered | function | Transition onEntered callback when animation is not | |
onEntering | function | Transition onEntering callback when animation is not | |
onExit | function | Transition onExit callback when animation is not | |
onExited | function | Transition onExited callback when animation is not | |
onExiting | function | Transition onExiting callback when animation is not | |
transition | boolean | elementType | Use animation when showing or hiding | |
unmountOnExit | boolean | Unmount the tab (remove it from the DOM) when it is no longer visible | |
bsPrefix | string | 'tab-pane' |