Creating single directory components with Drupal Canvas in mind
summary
Single-directory components rely on a complete component.yml so Drupal Canvas can read prop types, titles, examples generate the preview and slots; Canvas uses the first example for previews. Development uses Drush Generate SDC, Drupal CMS 2.0 (core 11.3.3) with Canvas 1.1.0 and Mercury theme, plus SDC devel and Drush SDCV for validation. Arrays show buggy add/remove behavior, object props require a schema.json ref, and Canvas-only keys enable a WYSIWYG prop and a media widget that tie to Canvas prop shapes.
AI-written summary · about
chapters (10)
- 0:00Introduction to SDCs
- 1:40SDC benefits and architecture
- 3:44Environment setup and validation
- 5:50Validating component development
- 8:44Best practices for SDC implementation
- 10:51Metadata and component configuration
- 15:50Defining and using props
- 26:16Advanced Canvas-specific props
- 30:58Ref schemas and complex data
- 40:39Final Q&A and wrap-up
