Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

components

41,502 sites Security covered
View on drupal.org

NOTE: If you’ve never used the Components module, we recommend you first look at Drupal core's Single Directory Components (SDC).

The Components module makes it easier for a theme to organize its components. It allows themes (and modules) to register Twig namespaces and provides some additional Twig functions and filters for use in Drupal templates.

What are Twig namespaces?

Twig natively offers a feature called “template namespaces”. Drupal core registers many Twig namespaces so that you can reference the Twig templates from specific modules or themes. For example, you may have seen this:

{% extends "@classy/block/block--system-menu-block.html.twig" %}

The text, @classy, indicates the Twig namespace we wish to use when getting the twig template.

Why use a custom Twig namespace?

Modern front-end development techniques means a website needs a component library where each component is concerned about a specific design element.

But Drupal core does not yet provide a component library for its design. Instead, Drupal core registers a Twig namespace for every module and theme in your installation (@bartik, @system, etc.) And all of those Twig templates are designed for specific Drupal theme hooks and data (nodes, comments, views, etc.) and must be placed in a /templates directory inside a module or theme.

Ideally, we would put our component library's Twig templates in a separate directory from the Drupal-style Twig templates. But Drupal core makes it very difficult to use Twig templates not placed in a /templates directory.

The Components module allows you to specify a different directory for you component library's Twig files and allows you to register a unique Twig namespace for those files.

Here's how you would register a @fusion Twig namespace where those files are stored in your theme's components/fusion folder:

components:
  namespaces:
    fusion:
      - components/fusion

More information

For more information about how to use this module, read the Components documentation.

Activity

Total releases
1
First release
Dec 2025
Latest release
4 months ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
3.2.0 Stable Dec 4, 2025