Responsive sliding tabs with CSS and jQuery
Sliding tabs playground
Choose a topic to slide in its panel. Try the keyboard too: arrow keys move focus; Enter or Space opens the focused tab.
01 / THE PATTERN
One topic at a time
Tabs organize related sections inside the same page. This demo reveals one panel with a short slide and keeps your focus on the chosen tab.
- Vertical navigation on wide screens
- Horizontal scrolling tabs on small screens
- All content stays readable without JavaScript
02 / BUILD IT
Start with readable HTML
- Link each tab to a unique section ID.
- Use CSS for layout, focus and motion.
- Enhance the links with jQuery events and ARIA states.
- Test with a mouse, keyboard and a narrow screen.
The ZIP includes local jQuery, CSS and source code. No build step is needed.
03 / TRY THE KEYS
Focus first, activate second
On a wide screen use Up and Down. On a narrow screen use Left and Right. Home and End jump to the first and last tab.
Press Enter or Space to display the focused topic. Press Tab to move into the selected panel. There is no automatic cycling.
04 / PRACTICE
Check your implementation
These practice checkboxes stay checked when you switch away and return.
Practice state is kept only while this page is open; it is not saved to a server.
Motion follows your device's reduced-motion setting. If JavaScript or jQuery is unavailable, the links jump to the four readable sections below them.