The Layout Builder Component Attributes module allows editors to add HTML attributes to Layout Builder components (blocks). Attributes can be added to 1) the block (outer) element, 2) the block title, and 3) the block content (inner) element.

(In order for attributes to be rendered on the the block content (inner) element, the active front-end theme must support content_attributes in its block.html.twig file. See README.md for more information.)

The following attributes are supported:

  • ID
  • Class(es)
  • Style
  • Data-* attributes

Note: The preferred installation method is Composer; however, beginning with version 1.1.0, this module also supports Ludwig for its dependencies.

Related Modules

Layout Builder Styles - Allows site builders to select from a list of styles to apply to Layout Builder blocks and sections. Styles are a set of defined CSS classes.
Block Attributes - Allows for attributes to be added to blocks (no Layout Builder support)
Block Class - Allows for classes to be added to blocks (Layout Builder support is postponed, pending core patch)

Supporting organizations:
sponsored initial development

Project information

Releases

2.4.0 Stable release covered by the Drupal Security Team released 13 October 2026
Works with Drupal: ^10.3 || >=11.1.8 <12 || ^12

Add D12 support

Install:

Development version: 2.x-dev updated 13 Oct 2026 at 03:50 UTC

2.3.0 Stable release covered by the Drupal Security Team released 15 June 2026
Works with Drupal: ^10 || ^11

PHP 8.4 support

Install:

Development version: 2.x-dev updated 13 Oct 2026 at 03:50 UTC