Skip to content

Tabs — wd-tabs

Category: Content · Tag: wd-tabsBack to: Components overview


What it does

A tabbed panel: a row of tab buttons, each revealing its own panel. The first tab is selected by default.


Adding it & its settings

Add Component → Content → Tabs.

Basic Settings (all components): #id, Classes, Inline Style.

Component Settings: none — the tabs are built from the content you put inside.


Content & slots

  • Default slot — one child element per tab. Each child provides:
    • a title attribute → the tab button label,
    • its inner HTML → the tab's panel content.
html
<wd-tabs>
  <div title="Overview">Product overview…</div>
  <div title="Specs">Technical specifications…</div>
  <div title="Reviews">Customer reviews…</div>
</wd-tabs>

The component reads these children on load, builds the tab bar and panels, and removes the originals.


Styling

CSS variables

Container & header

VariableDefault
--wd-tabs-border1px solid #ccc
--wd-tabs-border-radius4px
--wd-tabs-header-background#f7f7f7
--wd-tabs-header-border-bottom1px solid #ccc

Tab buttons

VariableDefault
--wd-tabs-button-color#555
--wd-tabs-button-font-familysans-serif
--wd-tabs-button-font-size1rem
--wd-tabs-button-font-weightnormal
--wd-tabs-button-min-height3rem
--wd-tabs-button-padding0.75rem 1rem
--wd-tabs-button-hover-background#e2e2e2
--wd-tabs-button-hover-color#333

Active tab

VariableDefault
--wd-tabs-button-active-backgroundtransparent
--wd-tabs-button-active-color#333
--wd-tabs-button-active-font-weightbold
--wd-tabs-button-active-indicator-color#333
--wd-tabs-button-indicator-width3px

Content

VariableDefault
--wd-tabs-content-padding1rem

::part()

PartElement
tabs-<id>The tabs wrapper.
css
wd-tabs::part(tabs-product) { border-radius: 8px; overflow: hidden; }

Notes

  • The component emits a tabChange event when the active tab changes (useful for custom scripts).