jQuery Tabs Plugin. CSS Tabs with Accessible and Responsive Design. Lot of Tab Themes with Vertical and Horizontal Orientation.

Overview

Macaw Tabs

Macaw Tabs is jQuery tabs plugin. It helps you to create accessible and responsive jQuery tabs by implementing the W3 design patterns for tabs.

Tabs are a set of layered sections of content, known as tab panels, that display one panel of content at a time. Each tab panel has an associated tab element, that when activated, displays the panel.

Design of vertical and horizontal tabs is very simple and easy with Macaw Tabs plugin.

Features

  • Flexible HTML Structure
  • Vertical Orientation Support
  • Horizontal Orientation Support
  • Tabs with Automatic Activation Support
  • Tabs with Manual Activation Support
  • Nested Tabs Support
  • Special Transition Class for Tab Panels
  • Keyboard Interaction Support
  • AI-ARIA Roles, States, and Properties Support
  • Lot of Tabs Themes

Setup

Macaw Tabs is very easy to setup in both HTML and CSS.

HTML Document Head Setup

You may need the followings in the head tag of HTML document,

Google Fonts

<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Oxygen:wght@400;700&family=Ubuntu:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">

Icon Fonts

<!-- Icon Fonts -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />

Macaw Tabs Theme

<!-- Macaw Tabs -->
<!-- Macaw Tabs Reset is Optional -->
<link rel="stylesheet" href="./dist/css/macaw-elegant-tabs-reset.css" type="text/css" media="all" />
<!-- Macaw Tabs Theme -->
<link rel="stylesheet" href="./dist/css/macaw-elegant-tabs.css" type="text/css" media="all" />

HTML Document Body Setup

Here is the example of Macaw tabs HTML markup. You can use the following markup in the body tag of your HTML document.

<div class="macaw-tabs macaw-elegant-tabs">
  <div role="tablist" aria-label="Resources">
    <button role="tab" aria-selected="true" aria-controls="blog-tab" id="blog"><span class="material-icons icon">assignment</span> <span class="label">Blog</span></button>
    <button role="tab" aria-selected="false" aria-controls="events-tab" id="events" tabindex="-1"><span class="material-icons icon">settings</span> <span class="label">Events</span></button>
    ....
    ....
  </div>

  <div tabindex="0" role="tabpanel" aria-labelledby="blog" id="blog-tab">
    <p>Vestibulum vitae feugiat quam, eget porttitor lacus.</p>
    <p>Cras volutpat diam quis odio cursus accumsan.</p>
  </div>
  <div tabindex="0" role="tabpanel" aria-labelledby="events" id="events-tab" hidden>
    <p>Nullam est ipsum, vestibulum non ullamcorper vitae.</p>
    <p>Class aptent taciti sociosqu ad litora torquent.</p>
  </div>
  ....
  ....
</div>

HTML Document Footer Setup

You may need the followings in the footer tag of HTML document,

jQuery Library

<!-- jQuery Library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>

Macaw Tabs Plugin

<!-- Macaw Tabs Plugin -->
<script src="./dist/js/macaw-tabs.js"></script>

Macaw Tabs Initialization

<!-- Macaw Tabs Initialization -->
<script>
  ( function ( $ ) {
    // Document Ready
    $( function () {
      $( '.macaw-tabs' ).macawTabs();
    } );
  } )( jQuery );
</script>

Options

Macaw Tabs has the following options,

// Default Settings
const defaults = {
  tabPanelAutoActivation: false,
  tabPanelTransitionLogic: true,
  tabPanelTransitionClass: 'active',
  tabPanelTransitionTimeout: 0,
  tabPanelTransitionTimeoutDuration: 50,
  autoVerticalOrientation: true,
  autoVerticalOrientationMaxWidth: '575px',
  onTabActivation() {},
};

tabPanelAutoActivation

This option allows you to set Automatic Activation of tabpanel of focused tab.

tabPanelAutoActivation: true | false

tabPanelTransitionLogic

By default, Tab Panels have hidden attribute. It will be difficult to implement CSS transition when the hidden attribute is removed for active tabpanel. This option allows you to set a class for tabpanel. This class can be used to implement CSS transition easily.

tabPanelTransitionLogic: true | false

tabPanelTransitionClass

tabPanelTransitionClass: 'active'

tabPanelTransitionTimeout

tabPanelTransitionTimeout: 0

tabPanelTransitionTimeoutDuration

tabPanelTransitionTimeoutDuration: 50

autoVerticalOrientation

Horizontal or Vertical design of tabs is controlled by CSS. Left and Right Arrow Keys control the direction of horizontal tabs. If the design of tabs is vertical on small displays than this option is handy for you. It will set appropriate direction of Arrow Keys for Horizontal or Vertical design.

Set this option true, if the design is vertical on small displays and horizontal on large displays. Set this option false if design is vertical at all displays.

autoVerticalOrientation: true | false

autoVerticalOrientationMaxWidth

This option allows the responsive boundary for the Horizontal or Vertical orientation.

autoVerticalOrientationMaxWidth: '575px'

Methods

Macaw Tabs has the following methods,

onTabActivation

This method will be called when a tab is set to active.

Keyboard Interaction Support

Special care has been given on the accessibility features. Tabs and Tabs Panels can easily be accessed with keyboard.

Tab Key

When focus moves into the tab list, places focus on the active tab element. When the tab list contains the focus, moves focus to the next element in the page tab sequence outside the tablist, which is typically either the first focusable element inside the tab panel or the tab panel itself.

Right Arrow Key

When focus is on a tab element in a horizontal tab list, Right Arrow key Moves focus to the next tab. If focus is on the last tab element, moves focus to the first tab. Optionally, activates the newly focused tab.

Left Arrow Key

When focus is on a tab element in a horizontal tab list, Left Arrow key moves focus to the previous tab. If focus is on the first tab, moves focus to the last tab. Optionally, activates the newly focused tab.

Down Arrow Key

If the tabs in a tab list are arranged vertically, Down Arrow key performs as Right Arrow key as described above.

Up Arrow Key

If the tabs in a tab list are arranged vertically, Up Arrow key performs as Left Arrow key as described above.

Space or Enter Key

When focus is on a tab in a tablist with either horizontal or vertical orientation, Space or Enter key activates the tab if it was not activated automatically on focus.

Home Key

When focus is on a tab in a tablist with either horizontal or vertical orientation, Home key moves focus to the first tab. Optionally, activates the newly focused tab.

End Key

When focus is on a tab in a tablist with either horizontal or vertical orientation, End key moves focus to the last tab. Optionally, activates the newly focused tab.

WAI-ARIA Roles, States, and Properties

Macaw Tabs jQuery pluign is developed to care the accessibility attributes in mind. Its HTML and CSS has satisfied the role, properties, states and attributes.

  • The element that serves as the container for the set of tabs has role tablist.
  • Each element that serves as a tab has role tab and is contained within the element with role tablist.
  • Each element that contains the content panel for a tab has role tabpanel.
  • If the tab list has a visible label, the element with role tablist has aria-labelledby set to a value that refers to the labelling element. Otherwise, the tablist element has a label provided by aria-label.
  • Each element with role tab has the property aria-controls referring to its associated tabpanel element.
  • The active tab element has the state aria-selected set to true and all other tab elements have it set to false.
  • Each element with role tabpanel has the property aria-labelledby referring to its associated tab element.
  • If the tablist element is vertically oriented, it has the property aria-orientation set to vertical. The default value of aria-orientation for a tablist element is horizontal.

Tab Themes

We are sharing Macaw Tab themes frequently to help you. Please have a look,

Build With Love ❤️

You might also like...

Simple and lightweight vertical 3-dot context menu

3-dot Context Menu Thanks for taking a look at our 3-dot context menu for web development. The 3-dot context menu allows a simple and lightweight impl

Nov 6, 2022

Story Show Gallery - JS & React - minimalist, vertical photo gallery, mobile friendly

 Story Show Gallery - JS & React - minimalist, vertical photo gallery, mobile friendly

Vertical photo gallery optimized for smartphones (notch area included). SSG will support your brand and marketing. Optimally placed captions, full screen lightbox, no ugly arrows

Oct 4, 2022

jQuery easy ticker is a news ticker like plugin, which scrolls the list infinitely. It is highly customizable, flexible with lot of features and works in all browsers.

jQuery Easy Ticker plugin jQuery easy ticker is a news ticker like plugin which scrolls a list infinitely. It is highly customizable, flexible with lo

Dec 20, 2022

A beautiful, responsive, highly customizable and accessible replacement for JavaScript's popup boxes. Zero dependencies.Alerts ,dialogs

AsgarAlert (v1) for JS Install script defer src="/asgar-alert.js"/script Examples The most basic message: asgar("Hello world!"); A message signali

Dec 20, 2022

Render (GitHub Flavoured with syntax highlighting) Markdown, and generate CSS for each of GitHub’s themes.

render-gfm Render (GitHub Flavoured with syntax highlighting) Markdown, and generate CSS for each of GitHub’s themes. GitHub Repository npm Package Do

Oct 10, 2022

Flexible, powerful and modern library for creating the running horizontal blocks effect, also known as ticker or the «marquee effect».

Flexible, powerful and modern library for creating the running horizontal blocks effect, also known as ticker or the «marquee effect».

Cuberto Reeller Flexible, powerful and modern library for creating the running horizontal blocks effect, also known as ticker or the «marquee effect».

Jan 4, 2023

Hourly weather card for Home Assistant. Visualize upcoming weather conditions as a colored horizontal bar.

Hourly weather card for Home Assistant. Visualize upcoming weather conditions as a colored horizontal bar.

Hourly Weather Card by @decompil3d An hourly weather card for Home Assistant. Visualize upcoming weather conditions as a colored horizontal bar. Can y

Dec 29, 2022

Horizontal Scaler for https://railway.app

Horizontal Scaler for https://railway.app

Horizontal Scaler for Railway Railway doesn't offer first-party support for horizontal scaling.Thus, I have built a workaround for now that allows sca

Jan 1, 2023

CSS is powerful, you can do a lot of things without JS.

CSS is powerful, you can do a lot of things without JS.

You Don't Need JavaScript Please note these demos should be considered as CSS "Proofs of Concepts". They may have serious issues from accessibility po

Jan 4, 2023
Releases(v1.0.4)
  • v1.0.4(Sep 6, 2021)

    v1.0.4 September 06, 2021

    • Update: Macaw Tabs jQuery plugin is updated to support nested tabs.
    • Update: Macaw Tabs jQuery plugin is updated to prevent re-activation logic of already active tab.
    • Update: Macaw Tabs Themes are updated to support nested tabs.
    • New: Macaw Comely Nested Tabs theme added.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.2(Aug 19, 2021)

  • v1.0.1(Aug 17, 2021)

  • v1.0.0(Aug 17, 2021)

Owner
HTMLCSSFreebies
Free HTML & CSS Resources for Creatives
HTMLCSSFreebies
jQuery Plugin for Ticker, News Ticker with Vertical, Horizontal, Marquee and Typewriting effects

AcmeTicker - News Ticker A very lightweight jQuery plugin for creating advanced news ticker. Demo: Gutentor News Ticker Ticker Type Vertical Horizonta

Santosh Kunwar 11 Sep 3, 2022
Responsive Tabs is a jQuery plugin that provides responsive tab functionality.

Responsive Tabs is a jQuery plugin that provides responsive tab functionality. The tabs transform to an accordion when it reaches a CSS breakpoint. You can use this plugin as a solution for displaying tabs elegantly on desktop, tablet and mobile.

Jelle Kralt 537 Dec 8, 2022
Horizontal Timeline 2.0, a fully customisable jQuery plugin to create a dynamic timeline on the horizontal axis.

Horizontal Timeline 2.0 by yCodeTech Twitter @yCodeTech Current Version: 2.0.5.3 Quick Links: Setup | Options | Autoplay | Known Issues | Known Issues

Stu 18 May 29, 2022
LiveTabs is a Javascript library that allows you to create and manage tabs on the fly. This library gives the ability to your application to act like browser tabs, making dynamic tabs.

LiveTabs Table of content Description Goals Technologies Setup Description LiveTabs is a Javascript library that allows you to create and manage tabs

Hossein Khalili 3 May 3, 2022
Basic, accessible, responsive and freely restyleable tabs.

Skeletabs · Skeletabs is an open source jQuery plugin that provides tabbed browsing feature to your web contents. It is focused on accessibility and s

Taesung, Lim 18 Nov 13, 2022
Chrome style tab-resizing for jQuery UI tabs

stretchy tabs Chrome style tab-resizing for jQuery UI tabs stretchy tabs provides methods for adding and removing tabs ##Initialize stretchy tabs $( "

Adam Jimenez 8 Nov 19, 2021
Meogic-tab-manager is an extensible, headless JavaScript tab manager framework.

MeogicTabManager English document MeogicTabManager是一个有可拓展性的、headless的JavaScript标签页管理框架。 MeogicTabManager旨在提供可自由组装页面框架、自定义页面组件、甚至覆盖框架自带事件响应的开发体验。 Meogi

meogic-tech 5 Oct 8, 2022
jQuery plugin to show a tabs bar for navigation. The tabs can be defined once, and shared across multiple HTML pages.

jquery.simpletabs v1.2.3 The jquery.simpletabs plugin shows a tabs bar for navigation. The tabs can be defined once, and shared across multiple HTML p

Peter Thoeny 1 Feb 23, 2022
You can easily create the horizontal timeline with two types by using this jQuery plugin.

jQuery.Timeline V2 You are able to easily create two types of horizontal timeline with this jQuery plugin. Report bug · Request feature · Blog Table o

ka2 222 Dec 9, 2022
Responsive tabs-to-accordion script without jQuery, written using pure JavaScript

vanilla-tabs Responsive tabs-to-accordion script without jQuery, written using pure JavaScript Author Dmytro Kudleichuk LinkedIn GitHub Online Demo Se

Dmitriy Kudleichuk 7 Dec 20, 2022