Pure HTML, CSS & JS Tabs No More Radio Button Hacks.

Live Demonstration

Interact with the tabs below—you can also use arrow keys to navigate them. The core tab switching logic is now handled by JavaScript, allowing for a more robust and extensible component.

Overview of all active projects. Use the search below to filter projects.

Details for Sub-Project Alpha, including its specific tasks and resource allocation.

Details for Sub-Project Beta, focusing on its timeline and deliverables.

Pending Tasks

  • Due: Tomorrow
  • Due: Oct 28
  • Due: Nov 2

Project Timelines

Phase 1: Research & Discovery 100%
Phase 2: UI/UX Design 75%
Phase 3: Development 40%
AV

Alex Vance

Lead Developer

BS

Brianna Shaw

UX/UI Designer

CJ

Carlos Jimenez

Project Manager

How It Works

This component has been engineered with a JavaScript-driven approach to create a modern, accessible, and extensible tab system. Unlike older methods that rely on radio-button hacks, our approach uses semantic HTML and is designed to work within modern CSS layouts like Flexbox or Grid. This model offers significant advantages:

  • Superior Accessibility: Implements full keyboard navigation (arrow keys, Home/End) and ARIA roles for screen reader compatibility.
  • Semantic & Modern Structure: Uses proper <button> and <div> elements, designed for modern CSS layouts like Grid. This avoids legacy radio button hacks for cleaner, more maintainable code.
  • Future-Ready: The structure is easily expandable with features like lazy-loading content.

The script manages the component's state by toggling an .active class for styling, while also updating key ARIA attributes (like aria-selected) and the tabindex to ensure the component is fully accessible. CSS handles all visual styling, and the only trade-off is that JavaScript is required, which is a standard for modern web applications.

Want to see the code in action? You can review the example below or open the full interactive editor to modify the code and see your changes instantly.

Example Code (HTML, CSS, JS)

Technical Documentation: ARIA & Accessibility

This tab component is not just about looks; it's built from the ground up with accessibility as a top priority. We intentionally use semantic HTML and avoid obsolete "radio button hacks," allowing the component to integrate cleanly into modern CSS layouts like Grid or Flexbox. This modern foundation allows us to fully adhere to the WAI-ARIA Authoring Practices Guide (APG) for Tabs to ensure the component is robust, understandable, and fully operable for all users, including those who rely on assistive technologies like screen readers or keyboard-only navigation.

The implementation correctly utilizes the following ARIA roles and properties to create a fully accessible tabbed interface:

Core Roles & Relationships

  • role="tablist"

    Applied to the button container, this role defines the element as a list of tabs, allowing screen readers to announce it as a single, cohesive widget.

  • role="tab"

    Identifies each button as an individual tab control. This role is essential for assistive technology to understand its function.

  • role="tabpanel"

    Identifies each content area that is associated with a tab, clearly defining its purpose as a panel of information.

  • aria-controls & aria-labelledby

    These properties create an explicit, two-way link: aria-controls on a tab points to its panel's ID, while aria-labelledby on a panel points to its controlling tab's ID. This robust connection is crucial for assistive technologies to announce the relationship between the active tab and its visible content panel.

State Management & Keyboard Interaction

  • aria-selected="true | false"

    Dynamically updated by the script, this state tells assistive technologies exactly which tab is currently active. Announcing "Tab, [Name], selected" provides clear feedback to the user.

  • Roving tabindex

    To create an intuitive keyboard experience, only the active tab has tabindex="0". All other tabs are set to tabindex="-1", removing them from the standard tab sequence. This prevents users from having to tediously tab through every single tab label.

  • Full Keyboard Support

    Once the tablist has focus, users can navigate with ease:
    Right/Left Arrows: Cycle between tabs.
    Home: Jump to the first tab.
    End: Jump to the last tab.

In conclusion, this implementation does not just simulate the appearance of tabs; it correctly implements the full ARIA design pattern, resulting in a component that is both functional and universally accessible.

Live Code Editor & Preview

HTML, CSS & JS Code

Live Preview