Tabs

Design

The indicator underline slides smoothly between tabs using transform: translateX(). Width adjusts to match each tab's size.

Code

Tab state is tracked with aria-selected for accessibility. Active panel is shown with a class toggle.

Preview

The transition is pure CSS — no JavaScript animation library needed. The indicator position is calculated and applied inline.