Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Views Accordion - Views Vanilla JavaScript Accordion (VVJA)

Security covered Maintenance fixes only 163 sites

This module provides a lightweight JavaScript-powered accordion style for Drupal Views. It offers various customization options for animation, layout, and accessibility, and does not require any external JavaScript libraries.

VVJA adds an accordion format to Drupal Views. It is for site builders who want a view's results shown as collapsible panels, such as an FAQ, without custom code.

Each result row becomes one panel. The first field of the row is the panel header button, and the remaining fields fill the panel. What sets VVJA apart from the other VVJ formats is this header and panel split, with settings for expand and collapse buttons, exclusive mode and your own SVG icons. It requires VVJ Core, which holds the settings shared by all VVJ formats.

Start here

Features

VVJA has no settings page of its own. Open a view under Structure > Views, set "Format" to "Views Vanilla JavaScript Accordion", then open "Settings". The format uses the "Fields" row plugin.

  • "Behavior settings": "Show collapse or expand (single)" puts a toggle on each header. "Show collapse or expand all (global)" adds one button that opens or closes every panel. "Enable exclusive mode" keeps one panel open at a time. "Default expand behavior" is "None", "Expand First Item" or "Expand All Items". Exclusive mode cannot be combined with the global button or with "Expand All Items"; the form shows an error if you try. Defaults: single toggle on, global button on, exclusive mode off, "Default expand behavior" set to "None".
  • "Animation settings": "Animation Type" and "Transition speed", from 0.1 to 2 seconds. Visitors who ask their device for reduced motion see no animation.
  • "Layout settings": "Expandable card width (px)" (0 keeps a full-width list), "Content padding (px)" and "Panel gap (px)".
  • "Custom icons": four fields, "Expand Panel Icon", "Collapse Panel Icon", "Expand All Icon" and "Collapse All Icon". Paste an SVG in each. VVJA checks it and removes scripts, event handlers and external references.
  • Shared sections: "Advanced options", "Deep linking settings", "Token documentation" and "Patterns" come from VVJ Core. With deep linking on, a link such as #accordion-faqs-3 opens the third panel. The identifier is lowercased, spaces and the _ character become hyphens, and it must keep at least one letter. The words accordion, panel, vvja and vvj are reserved.
  • Tokens: in the view header, footer or empty text, use [vvja:field] or [vvja:field:plain].
  • JavaScript API: Drupal.vvja.openPanel, closePanel, togglePanel, getOpenPanels, getTotalPanels and getInstance.
  • Without JavaScript: the content stays readable, and closed panels are inert so their controls cannot take focus.
  • Theme bridges: two libraries, pattern-bridge-solo and pattern-bridge-apex, map Pattern colors to the Solo and APEX theme colors.
  • Help page: read /admin/help/vvja after you enable the module.
  • Example view: an optional view named "VVJA Example" is available at /vvja-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. VVJA ships five:

  • Spotlight: photo panels side by side; the open one widens. Use 3 to 6 items.
  • Stage: numbered steps on the left and one photo stage on the right. It plays through the steps every 7 seconds with a visible Pause button, and stops when the visitor picks a step. Use 3 to 5 items.
  • Answers: text-only questions, with "Expand all" and deep linking on.
  • Cards: portrait photo cards. Use 3 to 8 items.
  • Agenda: a numbered rail, a "Copy link" button on each item and deep linking on.

Each Pattern needs the "Fields" row plugin, with every field excluded from display except two "Custom text" fields: the first is the header, the second is the panel. After you pick a Pattern, the list headed "To finish the Pattern" shows what is left to set. With vvj_patterns_demo enabled, demo pages appear at vvj/vvja/spotlight, stage, faq, cards and agenda.

Installation: get started in 3 steps

  1. Install the module with Composer. This also installs VVJ Core:
    composer require 'drupal/vvja:^2.0'
  2. Enable it on the Extend page, or with Drush:
    drush en vvja
  3. Open a view under Structure > Views, set "Format" to "Views Vanilla JavaScript Accordion", and open "Settings" to choose how the panels behave.

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.

Drupal 11 · not 10 PHP 8.3

Ask your assistant about Views Accordion - Views Vanilla JavaScript Accordion (VVJA)

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

Tracked releases
22
Tracked since
Aug 2024
Latest release
1 day ago
Releases (12 mo)
7
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.0.10 Stable 10–11 Jun 1, 2025
1.0.9 Stable 10–11 Mar 30, 2025
1.0.8 Stable 10–11 Mar 27, 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 20, 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