Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Custom Elements

636 sites Security covered Drupal 10–11
View on drupal.org

This module allows Drupal to generate markup for custom HTML elements, which can then be easily consumed by modern JavaScript frameworks and Web Components. It provides the tools to define how Drupal data is transformed into these custom elements, enabling a decoupled frontend approach.

The Custom Elements module provides the framework for rendering Drupal data (entities, fields, ...) into custom elements markup. Custom elements can be easily rendered by frontend components, e.g. via web components or various Javascript frontend frameworks. This enables Drupal to render into high-level theme components, while the actually rendering of the components is handled by a frontend application (possibly in the browser).

The Custom Elements module provides

  • the UI to configure the custom element output for entities by view-mode (3.x only)
  • the API to build a (nested tree) of custom element objects, with associated cache metadata
  • the API to serialize a tree of custom objects into markup or into a JSON representation
  • the API for other modules to customize how data is rendered into custom elements via custom element processors

Frontend rendering

Today's browsers provide an API for developers to define their own HTML elements, like <flag-icon country="nl"></flag-icon>. Besides that, many frontend frameworks render their components using the same, or similar custom elements syntax. That way, we can render a custom element output by Drupal with Web components or any component-oriented frontend
framework, like Vue.js or React.

Example

This is how twitter paragraph could look like:

<paragraph-twitter src="https://x.com/the_real_fago/status/1559907161328738304" title="The title"></paragraph-twitter>

Then a frontend framework could implement a suiting component with src and title attributes for rendering. Please refer to the Lupus Decoupled docs for a more complete example.

How to use it

The module can be used for progressively rendering individual entities via custom elements by using respective view-modes. Together with the Lupus Custom Elements Renderer module it may be used to fully decouple the frontend.

The easiest way to get started is to use Lupus Decoupled Drupal, which provides an easy to use, fully decoupled out-of-the-box setup with Custom Elements.

For more information and example usage, please refer to the Lupus Decoupled Documentation.

Optional features

  • Custom elements UI: Configure custom-elements output by entity view mode (3.x only)
  • Canvas and Canvas ExtJS support: Supports rendering canvas pages into custom elements (3.x only)
  • Thunder integration: Module that provides an example setup for Thunder paragraphs

Related modules

  • The module forms the core of Lupus Decoupled Drupal, which provides an easy to use, fully decoupled out-of-the-box setup with Custom Elements.
  • Lupus Custom Elements Renderer - Switches the main content renderer to provide API responses using custom elements markup or a custom elements json serialization.

Status

  • Version 3.x is recommended and contains more features
  • Version 2.x is receives security and critical bug fixes only. Upgrade to 3.x!
  • 1.x is (long) obsolete and not supported anymore.

Contribute

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

1 tracked project depends on this one

Activity

Tracked releases
19
Tracked since
Sep 2024
Latest release
2 weeks ago
Releases (12 mo)
14 ▲ from 5
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
3.5.0-beta1 Pre-release 10–11 Aug 12, 2026
3.4.1 Stable 10–11 Apr 29, 2026
3.4.0 Stable 10–11 Apr 29, 2026
3.3.9 Stable 10–11 Apr 27, 2026
3.3.8 Stable 10–11 Apr 14, 2026
3.3.7 Stable 10–11 Apr 14, 2026
3.3.6 Stable 10–11 Mar 23, 2026
3.3.5 Stable 10–11 Mar 11, 2026
3.3.4 Stable 10–11 Feb 25, 2026
3.3.3 Stable 10–11 Feb 4, 2026
3.3.2 Stable 10–11 Dec 16, 2025
3.3.1 Stable 10–11 Dec 5, 2025
3.3.0 Stable 10–11 Dec 4, 2025
3.2.0 Stable 10–11 Oct 12, 2025
3.1.0 Stable 10–11 Jun 4, 2025
3.0.2 Stable 10–11 Feb 7, 2025
3.0.1 Stable 10–11 Nov 16, 2024
8.x-2.6 Stable 10–11 Sep 27, 2024
3.0.0 Stable 10–11 Sep 27, 2024