Building with Drupal 11 Canvas: How to Create a Custom Hero Component Using SDCs

man working on laptop
pressfoto / Freepik

In his blog post “Building with Drupal 11 Canvas: Creating a Custom Hero Component,” George Bonnici explores Drupal 11’s new Canvas visual builder and demonstrates how developers can create reusable, production-ready components using Single Directory Components (SDCs). He explains the installation of the Canvas module via Composer, the crucial configuration settings for component discovery, and how Drupal seamlessly integrates Canvas for a flexible, performance-optimised page-building experience.

George provides a hands-on walkthrough for building a Hero section—from defining metadata hero.component.yml to creating a Twig template and responsive CSS. The guide highlights best practices like semantic HTML, BEM-based styling, and variant creation for adaptability. With Canvas, Drupal 11 empowers both developers and site builders to visually assemble pages while maintaining consistency, reusability, and performance.

Disclosure: This content is produced with the assistance of AI.

Disclaimer: The opinions expressed in this story do not necessarily represent that of TheDropTimes. We regularly share third-party blog posts that feature Drupal in good faith. TDT recommends Reader's discretion while consuming such content, as the veracity/authenticity of the story depends on the blogger and their motives. 

Note: The vision of this web portal is to help promote news and stories around the Drupal community and promote and celebrate the people and organizations in the community. We strive to create and distribute our content based on these content policy. If you see any omission/variation on this please reach out to us at #thedroptimes channel on Drupal Slack and we will try to address the issue as best we can.

Related Drupal Initiatives

Upcoming Events

Latest Opportunities