Component-based design in Drupal: SDC, Canvas & AI

About the Author

Ala

Digital Marketer

FAQs

Component-based design in Drupal is a front-end methodology that builds pages from small, reusable, self-contained units called components, instead of theming each page as one monolithic template. It improves consistency, development speed, collaboration, and scalability. In Drupal, component-based design is delivered natively through Single Directory Components, which became stable in Drupal core in version 10.3.

Single Directory Components (SDC) are Drupal's native components, where everything a component needs lives in one directory: a Twig template, a .component.yml schema defining props and slots, and optional CSS and JavaScript. SDC has been stable in Drupal core since version 10.3 (2024), so themes and modules can use components without enabling any extra module.

Component variants in Single Directory Components require Drupal 11.2 or later, where they shipped in 2025. Variants let a single component define multiple named styles, such as a light and a dark card, without duplicating the component. On Drupal 10.3 through 11.1, SDC works but lacks native variants, so teams simulate them with a custom variant prop.

Drupal SDC and React share the principle of defining a UI component once and reusing it anywhere, but they render differently. SDC components render server-side through Twig and bundle a Twig template, YAML schema, CSS, and JS in one directory. React components run client-side in a JavaScript runtime and bundle markup, logic, and style in JSX. Both promote encapsulation, reusability, and consistency.

Drupal Canvas, the visual page builder that reached version 1.0 in December 2025, is built on Single Directory Components and lets users assemble pages by dragging components onto a canvas. Its AI Assistant takes a plain-language prompt, scans the site's library of components, and selects and places the right ones to build the layout, so a well-described component library becomes the foundation for AI-assisted authoring.

Join the conversation +