Skip to main content Red Hat Design System logo Contribute on Github v1.4.5

Tabs

Overview Style Guidelines Code Demos Accessibility

Installation

Usage

<rh-tabs>
  <rh-tab slot="tab">Tab 1</rh-tab>
  <rh-tab-panel>Tab 1 content</rh-tab-panel>
  <rh-tab slot="tab">Tab 2</rh-tab>
  <rh-tab-panel>Tab 2 content</rh-tab-panel>
  <rh-tab slot="tab">Tab 3</rh-tab>
  <rh-tab-panel>Tab 3 content</rh-tab-panel>
  <rh-tab slot="tab">Tab 4</rh-tab>
  <rh-tab-panel>Tab 4 content</rh-tab-panel>
</rh-tabs>

rh-tabs

Slots 2
Slot Name Description
tab

Must contain one or more <rh-tab>

Must contain one or more <rh-tab-panel>

Attributes 8
DOM Property Description Type Default
labelScrollLeft

Label for the scroll left button

string
'Scroll left'
labelScrollRight

Label for the scroll right button

string
'Scroll right'
manual

Tabs can be either automatic activated or manual

boolean
false
activeIndex

Index of the active tab

unknown
unknown
colorPalette

Sets color context for child components, overrides parent context

ColorPalette | undefined
unknown
centered

Aligns tabs to the center

boolean
false
box

Sets tabs to a boxed style with or without an inset

'box' | 'inset' | undefined
unknown
vertical

Sets the alignment of the tabs vertical

boolean
false
Methods 1
Method Name Description
select(option: RhTab | number)
Events 0

None

CSS Shadow Parts 4
Part Name Description
container

outer container

tabs-container

tabs container

tabs

tablist

panels

panels

CSS Custom Properties 2
CSS Property Description Default
--rh-tabs-border-color

Tabs Border color

#c7c7c7
--rh-tabs-inset

Tabs inset

auto
Design Tokens 0

None

rh-tab

The tab button for use within a rh-tabs element, must be paired with a rh-tab-panel.

Slots 2
Slot Name Description
icon

Can contain an <svg> or <rh-icon>

Tab title text

Attributes 2
DOM Property Description Type Default
active

True when the tab is selected

boolean
false
disabled

True when the tab is disabled

boolean
false
Methods 0

None

Events 1
Event Name Description
expand

when a tab expands

CSS Shadow Parts 3
Part Name Description
button

element that contains the interactive part of a tab

icon

icon <span> element

text

tile text <span> element

CSS Custom Properties 6
CSS Property Description Default
--rh-tabs-link-color

Tab link text color

#4d4d4d
--rh-tabs-active-border-color

Tab active border color

#ff442b
--rh-tabs-link-padding-inline-start

Tab padding inline start

32px
--rh-tabs-link-padding-block-start

Tab padding block start

16px
--rh-tabs-link-padding-inline-end

Tab padding inline end

32px`
--rh-tabs-link-padding-block-end

Tab padding block end

16px
Design Tokens 0

None

rh-tab-panel

The tab panel for use within a rh-tabs element, must be paired with a rh-tab.

Slots 1
Slot Name Description

Panel content should follow guidelines for tab panel content layout

Attributes 0

None

Methods 0

None

Events 0

None

CSS Shadow Parts 0

None

CSS Custom Properties 0

None

Design Tokens 0

None

© 2021-2024 Red Hat, Inc. Deploys by Netlify