Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Canvas Code Components as SDC

No security coverage Under active development 8 sites

This module makes React code components built with Drupal Canvas reusable throughout your Drupal site. It allows you to use these components in various Drupal templates, render arrays, and PHP code, enabling consistent theming across your entire project.

Drupal Canvas lets you build React code components in the browser, but they can only be placed using Canvas.. This module registers each one as a Single Directory Component, so the rest of your site can use them too.

Use it to theme anything Canvas doesn't reach:

  1. Node, term, user, media and Commerce templates — node--article.html.twig, field--*.html.twig
  2. Views row and field templates
  3. Blocks, regions, menus, page.html.twig, html.html.twig
  4. Any render array, from a preprocess function, block plugin, field formatter, controller or Layout Builder

From a Twig template:

{{ include('code_component:hero', { title: 'Hello' }) }}

Or from PHP:

$build['promo'] = [
  '#type' => 'component',
  '#component' => 'code_component:hero',
  '#props' => ['title' => 'Hello'],
];

Props and slots come straight from the code component, and rendering reuses Canvas's own hydration, so a component behaves the same whether it is placed in Canvas or called from a template.

Ask your assistant about Canvas Code Components as SDC

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

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Aug 2026
Latest release
3 months ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Core PHP Release date
1.0.0-alpha1 Pre-release 11 Aug 9, 2026
1.0.x-dev Dev 11 Aug 9, 2026