DEV Community

Giorgos Sarigiannidis
Giorgos Sarigiannidis

Posted on

1 1

Tabs on desktop, accordion on mobile (vanilla JS)

A tabbed component that turns into an accordion when tabs run out of space, using CSS and vanilla JavaScript. If you are on desktop, try to resize the screen and watch the tabs transforming to an accordion when they run out of space.

Top comments (0)

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay