This module provides a lightweight, jQuery-free Views style plugin to display content in tabs using vanilla JavaScript. It offers various customization options for tab positioning, animations, responsiveness, and includes accessibility features for keyboard navigation and ARIA support.
VVJT adds a tabs format to Drupal Views. It is for site builders who want a view's results shown as tabs with one pane open at a time, without custom code.
Each result row becomes one tab. The first field of the row is the tab button, and the remaining fields fill that tab's pane. What sets VVJT apart from the other VVJ formats is the tab placement: tabs can sit at the top, right, bottom or left, with a choice between scrolling and wrapping when they do not fit. It requires VVJ Core, which holds the settings shared by all VVJ formats.
Start here
Features
VVJT has no settings page of its own. Open a view under Structure > Views, set "Format" to "Views Vanilla JavaScript Tabs", then open "Settings". The format uses the "Fields" row plugin.
- "Layout settings": "Tabs position" is Top (default), Right, Bottom or Left. "Wrap tabs when exceeded" is off by default, which makes the tab row scroll. "Max width (px) for tabs" (required, default 300, 0 is automatic) and "Max height (px) for vertical tabs buttons container (left/right)" (required, default 0 is automatic).
- "Animation settings": "Animation Type" is None, Zoom, Opacity, or Slide from Top, Bottom, Left or Right. The default is Slide from Bottom. Visitors who ask their device for reduced motion see no animation.
- "Styling settings": "Tabs buttons background color" (default #ECECEC), "Tabs panes background color" (default #F7F7F7) and "Disable background colors for buttons and panes".
- "Responsive settings": "Responsive Breakpoint for Vertical Tabs" is 576, 768, 992 (default), 1200 or 1400 px. Below it, tabs on the left or right become a horizontal row.
- Deep linking: in "Deep linking settings", set a "URL identifier". An identifier of
productsmakes links like#tabs-products-1. The wordstabs,tab,vvjtandvvjare reserved. - Keyboard: the tabs follow the standard tab pattern. Home, End, Enter and Space work, and the selected tab is marked for screen readers.
- Shared sections: "Advanced options" with "Enable CSS library", "Token documentation" and "Patterns" come from VVJ Core.
- Tokens: in the view header, footer or empty text, use
[vvjt:field]or[vvjt:field:plain]. - JavaScript API:
Drupal.vvjt.getInstance,getAllInstances,goToTab,getCurrentTabandgetTotalTabs. - Theme bridges: two stylesheets map Pattern colors to the APEX and Solo themes.
- Help page: read
/admin/help/vvjtafter you enable the module. - Example view: an optional view named "VVJT Example" is available at
/vvjt-example. It needs the Article content type.
Patterns
A Pattern is a ready-made design. Enable the VVJ Patterns submodule from VVJ Core, then choose a Pattern in the "Patterns" section. VVJT ships five:
- Dock: dark. A full-width photo stage with the words bottom left and the tabs in a floating dock at the bottom.
- Contents: light. A numbered contents list on the left with a progress rail, and the open chapter on the right.
- Swatch: light. Photo thumbnails as tabs in a rail on the right; the picture opens as a circle with a words card over it.
- Folder: light. Tabs joined to a raised card like folder tabs, with a square picture and shareable links to each tab.
- Glossary: light. A scrolling strip of terms with scroll buttons and a counter over a wide cinema picture.
After you pick a Pattern, the list headed "To finish the Pattern" shows what is left to set. With vvj_patterns_demo enabled, example content and demo views are added.
Installation: get started in 3 steps
- Install the module with Composer. This also installs VVJ Core:
composer require 'drupal/vvjt:^2.0' - Enable it on the Extend page, or with Drush:
drush en vvjt - Open a view under Structure > Views, set "Format" to "Views Vanilla JavaScript Tabs", and open "Settings" to choose where the tabs sit.
To upgrade from VVJ 1.x, upgrade every installed VVJ module to 2.x together. Mixing 1.x and 2.x is not supported. The steps are on the VVJ Core page.
Requirements
- Drupal ^11.3 || ^12
- PHP 8.3 or later
- VVJ Core
- Views and Filter (both in Drupal core)
Sites on Drupal 10 or on Drupal 11.0 to 11.2, or on PHP 8.1 or 8.2, stay on VVJ 1.x.
Support and maintenance
Questions, ideas, and bug reports are welcome. Please use this project’s issue queue so discussions and solutions remain available to the Drupal community.
Maintainers monitor issues, but response times depend on availability.
Developed and maintained by Alaa Haddad of Flash Web Center, LLC.
AI disclosure: AI tools assisted with drafting and reviewing this project description. The maintainer verified the final content against the project source.
Ask your assistant about Views Tabs - Views Vanilla JavaScript Tabs (VVJT)
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
- VVJ Core
- filter Drupal core
- views Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 1.0.8 | Stable | 10–11 | Jun 1, 2025 | ||
| 1.0.7 | Stable | 10–11 | Jan 21, 2025 | ||
| 1.0.6 | Stable | 10–11 | Aug 30, 2024 | ||
| 1.0.5 | Stable | 10–11 | Aug 21, 2024 | ||
| 1.0.4 | Stable | 10–11 | Aug 19, 2024 | ||
| 1.0.3 | Stable | 10–11 | Aug 17, 2024 | ||
| 1.0.2 | Stable | 10–11 | Aug 9, 2024 | ||
| 1.0.1 | Stable | 10–11 | Aug 3, 2024 | ||
| 1.0.0 | Stable | 10–11 | Aug 3, 2024 | ||
| 1.0.x-dev | Dev | 10–11 | Aug 1, 2024 |