VVJ logo
Views Vanilla JavaScript Tabs (VVJT) Screenshot

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 products makes links like #tabs-products-1. The words tabs, tab, vvjt and vvj are 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, getCurrentTab and getTotalTabs.
  • Theme bridges: two stylesheets map Pattern colors to the APEX and Solo themes.
  • Help page: read /admin/help/vvjt after 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

  1. Install the module with Composer. This also installs VVJ Core:
    composer require 'drupal/vvjt:^2.0'
  2. Enable it on the Extend page, or with Drush:
    drush en vvjt
  3. 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.

Flash Web Center, LLC. Drupal sites, themes and modules. Built and maintained by Alaa Haddad.

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.

Supporting organizations: 
Drupal development
Drupal hosting and maintenance

Project information

Releases