A focused frontend mini challenge built around a common interface pattern: switching between related content without leaving the current page.
The challenge focuses on interaction design, active states, keyboard navigation, accessibility, responsive layout, and purposeful animation.
Rather than building a large application, this project keeps the scope intentionally small and concentrates on getting one UI interaction right.
The Interactive Tabs & Content Switcher is a responsive interface that allows users to switch between three workspace sections:
- Overview
- Activity
- Preferences
Each tab displays a different content panel while keeping the user in the same context.
The interface includes an animated tab indicator, content transition, keyboard navigation, accessible tab semantics, responsive behavior, and interactive preference switches.
This mini challenge focuses on:
- Interactive tabs
- DOM manipulation
- Active UI states
- Content switching
- CSS transitions
- Micro-interactions
- Keyboard navigation
- Accessibility
- Responsive design
- Semantic HTML
- Vanilla JavaScript
The goal is to understand how a reusable UI interaction is structured and implemented.
The main goals of this challenge were:
- Build a functional tab component.
- Switch content without reloading the page.
- Create a clear active tab state.
- Animate the tab indicator.
- Animate newly displayed content.
- Practice DOM manipulation.
- Practice
data-*attributes. - Implement keyboard tab navigation.
- Practice accessible ARIA tab patterns.
- Create responsive behavior.
- Use animation to communicate a state change.
- Keep the UI visually simple and focused.
Used for:
- Semantic structure
- Buttons
- Sections
- Articles
- Lists
- Labels
- Accessibility attributes
- Tab and tab-panel semantics
Used for:
- Layout
- Custom properties
- Responsive design
- Active states
- Hover states
- Focus states
- Transitions
- Animations
- Custom switches
- Reduced-motion support
Used for:
- Supporting frontend structure
- Responsive utilities
- Bootstrap Icons
The primary visual styling is handled through custom CSS.
Used for:
- Tab switching
- DOM manipulation
- Active states
- Content visibility
- Keyboard navigation
- Indicator movement
- Accessibility updates
DM Sans is used for interface typography.
mini-interactive-tabs/
│
├── index.html
├── style.css
├── script.js
│
├── assets/
│ └── images/
│ └── screenshot.jpeg
│
└── README.md
The interface contains three sections:
Overview
Activity
Preferences
Clicking a tab changes the displayed content without refreshing the page.
The selected tab has a subtle white indicator behind it.
When the user changes tabs, the indicator moves horizontally to the new position.
This creates a clear connection between:
selected navigation → selected content
New content enters with a short vertical fade animation.
The animation is intentionally subtle so the interaction remains fast and easy to understand.
The Overview section provides a small workspace summary containing:
- Active projects
- Tasks this week
- Last activity
A supporting action allows the user to continue into the workspace.
The Activity section shows recent workspace changes.
Each activity contains:
- Activity marker
- Description
- Relative time
This provides a simple example of a chronological activity pattern.
The Preferences section demonstrates interactive switches.
The example preferences include:
- Email notifications
- Weekly summary
The switches are implemented with native checkbox inputs and custom CSS styling.
The tabs support keyboard interaction.
Supported keys include:
Arrow Right
Arrow Left
Home
End
This allows users to move through the tab interface without relying on a mouse.
The component uses ARIA attributes including:
role="tablist"
role="tab"
role="tabpanel"
aria-selected
aria-controls
aria-labelledby
Only the active tab remains in the normal keyboard tab order.
The interface adapts to:
- Desktop
- Tablet
- Mobile
- Small mobile screens
The component maintains readable spacing and typography across different viewport sizes.
Interactive elements include visible keyboard focus states.
This helps users understand where keyboard focus currently exists.
The interface respects:
prefers-reduced-motion
When reduced motion is enabled, animations and transitions are minimized.
The design intentionally avoids excessive visual decoration.
Instead of using:
- Large gradients
- Glassmorphism
- Floating shapes
- Heavy shadows
- Excessive rounded cards
- Decorative animation
the interface focuses on:
Hierarchy
↓
Clarity
↓
State
↓
Feedback
↓
Interaction
The main component is kept visually quiet so the tab interaction becomes the primary focus.
The interaction follows this pattern:
User selects a tab
↓
Active tab state changes
↓
Indicator moves
↓
Corresponding panel becomes visible
↓
New content fades upward
↓
User understands the new section
This creates a direct relationship between navigation and content.
Animations were intentionally kept small.
The active indicator slides between tabs.
The newly selected panel enters with a short fade and vertical movement.
Action buttons move slightly on hover.
The switch thumb moves smoothly when its state changes.
When the user prefers reduced motion, unnecessary animations are minimized.
The goal is:
motion that communicates change, not motion for decoration.
The tab component is controlled using Vanilla JavaScript.
The main function is:
activateTab(index);It handles:
- Active tab state
aria-selectedtabindex- Indicator position
- Panel visibility
- Keyboard focus
The tab name is stored using a data-tab attribute.
Example:
data-tab="overview"This allows JavaScript to identify the corresponding content panel.
Accessibility considerations include:
- Semantic buttons
- ARIA tab roles
aria-selectedaria-controlsaria-labelledby- Keyboard navigation
- Roving
tabindex - Visible focus states
- Native checkbox controls
- Reduced-motion support
The interaction is designed to remain usable without relying entirely on pointer input.
git clone https://github.com/codingwithvignesh/mini-interactive-tabs.gitcd mini-interactive-tabsOpen the file directly in your browser.
For development, VS Code with Live Server can also be used.
Through this mini challenge, I practiced:
- HTML5 semantic structure
- Interactive tabs
- Content switching
- DOM manipulation
data-*attributes- CSS transitions
- CSS animations
- Active states
- Hover states
- Focus states
- Keyboard navigation
- ARIA attributes
- Responsive design
- Custom switches
- Vanilla JavaScript
- UI state management
- Micro-interactions
- Reduced-motion support
Created the tab navigation and three content panels using HTML5.
Focused on:
- Semantic structure
- Navigation hierarchy
- Content organization
- Accessibility attributes
Created the visual interface using CSS.
Focused on:
- Typography
- Spacing
- Borders
- Active states
- Responsive behavior
- Focus states
Added JavaScript for:
- Tab switching
- Panel visibility
- Active states
- Indicator movement
- Keyboard navigation
Added small animations to communicate:
- Tab changes
- Content changes
- Hover interactions
- Switch state changes
Tested the component across:
- Desktop
- Tablet
- Mobile
- Keyboard navigation
- Reduced-motion settings
- Overview tab works.
- Activity tab works.
- Preferences tab works.
- Only one panel is visible at a time.
- Active tab is visually clear.
- Indicator moves correctly.
- Tab indicator animates.
- New content enters smoothly.
- Button hover interaction works.
- Switch animation works.
- Reduced-motion preference works.
- Arrow Right changes tab.
- Arrow Left changes tab.
- Home moves to first tab.
- End moves to last tab.
- Focus is visible.
- Tabs have correct ARIA attributes.
- Panels have correct relationships.
- Active tab has
aria-selected="true". - Inactive tabs have
aria-selected="false". - Keyboard navigation works.
- Desktop layout works.
- Tablet layout works.
- Mobile layout works.
- Small mobile layout works.
- Text remains readable.
- Buttons remain accessible.
Possible improvements for a future version include:
- URL hash support for individual tabs
- Swipe navigation on mobile
- Tab persistence using localStorage
- More complex reusable tab configuration
- Automated accessibility testing
- Component extraction into a reusable JavaScript module
These improvements are intentionally outside the current mini challenge.
The current goal is to master the core tab interaction first.
The project is designed for modern browsers supporting:
- HTML5
- CSS3
- JavaScript ES6+
- CSS custom properties
- CSS animations
- ARIA attributes
Recommended browsers:
- Google Chrome
- Microsoft Edge
- Mozilla Firefox
- Safari
Vignesh Govindaraj
UI/UX Designer • Front-End Developer
https://vigneshux.netlify.app/
https://github.com/codingwithvignesh
https://www.behance.net/vigneshgovindaraj
This project is part of my frontend mini challenge series.
The purpose of these challenges is to build small interfaces and interactions consistently instead of immediately jumping into large applications.
The learning pattern is:
HTML
↓
CSS
↓
JavaScript
↓
Interactive UI
The project pattern is:
STRUCTURE
•
STYLE
•
INTERACTION
This challenge specifically focuses on:
Interactive Navigation • UI States • DOM Manipulation • Accessibility • Animation
Projects in this challenge series use my personal GitHub topic:
vignesh-builds
This identifies projects that I personally build as part of my UI/UX and frontend development practice.
This project is created for educational and personal portfolio purposes.
You are welcome to explore the code and use the ideas for learning.
Built with HTML5, CSS3, Bootstrap 5, and Vanilla JavaScript.


