Tab
Tab component is a web component that displays a tabbed interface. It can be used to switch between different sections of content.
Design system docs
Examples
Default tab
Tab items must be used with the dap-ds-tab-group
component. The
dap-ds-tab
component is used to create a tab. The tabId
attribute is used to identify the tab and it is mandantory. The content of the tab is placed inside the content
slot.
Custom tab
Tabs can be customized with icons or other components. It can accept any component as a child.
Sizes
Tabs can be small or large. Default size is sm
Mobile
Tabs can be stacked on mobile devices with the mobile
attribute.
Importing
Importing React
Attributes
Property Type Default Description tabId
string
The tab id. Required disabled
boolean
false
The disabled state of the tab.
Slots
Name Description (default)
The tab title template. content
The tab content.
Events
No custom events available.
CSS Parts
Part Name Description base
The main tab content container.
CSS Custom Properties
No CSS custom properties available.
Components
Tab group
<dap-ds-tab-group/>
Attributes
Property Type Default Description selectedTabId
string
The selected tab id. size
'sm'
, 'lg'
'sm'
The size of the tab buttons. Default is sm
. Can be sm
or lg
. mobile
boolean
false
If true, the tab group will be displayed in mobile mode.
Slots
Name Description (default)
The tab items.
Events
Event Name Description dds-tab-select
Fired when select a new tab.
CSS Parts
Part Name Description base
The main container. tab-nav
The tab navigation container. tab-content
The tab content container.
CSS Custom Properties
Property Name Description --dds-tab-group-border-radius
Border radius of the tab group container --dds-tab-group-border-width
Border width of the tab navigation --dds-tab-group-border-color
Border color of the tab navigation --dds-tab-height-sm
Height of small tabs --dds-tab-height-lg
Height of large tabs --dds-tab-font-size-sm
Font size of small tabs --dds-tab-font-size-lg
Font size of large tabs --dds-tab-padding
Padding of the tab buttons --dds-tab-border-width
Border width for tabs --dds-tab-selected-border-color
Border color for selected tabs --dds-tab-text-color
Text color for tabs --dds-tab-hover-text-color
Text color for tabs on hover --dds-tab-disabled-text-color
Text color for disabled tabs --dds-tab-hover-background
Background color for tabs on hover --dds-tab-active-background
Background color for active tabs