Segmented Tabs

Segmented tabs with a gliding highlight that stretches and settles as you switch.

  • <kt-kinetic-tabs>
  • Navigation
  • No framework

Segmented Tabs

The code

Copy the Segmented Tabs

Fastest: press Copy on the card above for one complete file. To build it into your own project, use the files below: the markup, the styles, this component’s script and the shared effects script (effects.js) that every component uses.

<kt-kinetic-tabs items="Design,Code,Preview" active="0" sfx="シュッ!"></kt-kinetic-tabs>

<kt-kinetic-tabs items="Daily,Weekly,Monthly" active="1" sfx="スパッ!"></kt-kinetic-tabs>

Attributes

NameWhat it doesDefault
itemsComma-separated tab names.—
activeIndex of the selected tab, starting at 0.0
sfxSound-effect text on change.—

Keyboard and screen readers

  • role="tablist" with role="tab" and aria-selected.
  • Left and right arrow keys move between tabs.

Styling variables

Every look is a CSS variable: --kt-accent, --kt-accent-ink, --kt-radius-btn, --kt-surface-radius, --kt-surface-bg, --kt-border-w, --kt-comp-shadow and --font-sans. The copied file sets them all from your choices.

FAQ

Segmented Tabs: questions answered

How do I use the Segmented Tabs?

Press Copy on the card to get a complete HTML file, or copy the HTML, CSS and JavaScript tabs into your own page. In your markup the element is written as <kt-kinetic-tabs>.

Which attributes does <kt-kinetic-tabs> accept?

items, active, sfx. Each one is described in the attributes table on this page.

Is the Segmented Tabs accessible?

role="tablist" with role="tab" and aria-selected. Left and right arrow keys move between tabs.

Can I change the Segmented Tabs colors, corners and font?

Yes. Use the options on this page: accent color, border radius, background, border, shadow and Google font. The copied code already contains your choices, and every one of them is a CSS variable you can edit later.