All skills
grasmash avatar

/drupal-canvas

@8d7463f

Drupal Canvas Code Components - a framework for building interactive, server-side-rendered components in Drupal. Covers scaffolding with @drupal-canvas/create, the Nebula starter template, component architecture, and integration with Acquia Source Site Builder.

Use this Skill: https://skilld.dev/gh/grasmash/drupal-claude-skills/drupal-canvas

This session only. Nothing lands on disk.

SKILL.md

β‰ˆ69 tokens always: the name and description. β‰ˆ865 when used: this file.

Drupal Canvas Code Components

Canvas Code Components enable interactive, server-side-rendered components in Drupal using modern JavaScript patterns with full Drupal integration.

When This Skill Activates

Activates when working with:

  • Canvas Code Components (creation, configuration, styling)
  • @drupal-canvas/create scaffolding tool
  • Nebula starter template
  • Acquia Source Site Builder integration
  • Component-based Drupal architecture

Quick Start

Scaffold a New Canvas Project

npx @drupal-canvas/create my-project

This creates a complete Drupal project with Canvas Code Components pre-configured, including:

  • Drupal core with Canvas module
  • Example components
  • Development tooling
  • Nebula starter template

Install Canvas Skills for Detailed Guidance

For comprehensive component development guidance (7 detailed skills covering definition, metadata, composability, styling, utilities, data fetching, and upload workflows):

npx skills add drupal-canvas/skills

What Are Code Components?

Code Components are Drupal's approach to interactive, reusable UI components that:

  • Server-side rendered β€” Full SSR with hydration, not client-only
  • Drupal-integrated β€” Access entities, fields, views, and Drupal APIs
  • Composable β€” Nest components, pass props, emit events
  • Styled β€” Scoped CSS with design token support
  • Type-safe β€” Full TypeScript support with prop validation

Component Structure

my-component/
β”œβ”€β”€ my-component.component.tsx   # Component logic
β”œβ”€β”€ my-component.metadata.json   # Drupal integration metadata
β”œβ”€β”€ my-component.styles.css      # Scoped styles
└── my-component.utils.ts        # Optional utilities

Example Component

import { type ComponentProps } from '@drupal-canvas/sdk';

export default function MyComponent({ title, items }: ComponentProps) {
  return (
    <div className="my-component">
      <h2>{title}</h2>
      <ul>
        {items.map((item, i) => (
          <li key={i}>{item.label}</li>
        ))}
      </ul>
    </div>
  );
}

Ecosystem

Nebula Starter Template

The recommended starting point for new Canvas projects. Includes:

  • Pre-configured Drupal with Canvas module
  • Example components demonstrating all patterns
  • DDEV local development setup
  • Deployment configuration

Acquia Source Site Builder

Canvas components integrate with Acquia's Source Site Builder for:

  • Visual component placement and configuration
  • Content editor-friendly component management
  • Design system integration
  • Multi-site component sharing

Canvas Skills Collection

Install the full Canvas skills collection for detailed development guidance:

npx skills add drupal-canvas/skills

Covers 7 topics:

  1. Component Definition β€” Creating and registering components
  2. Metadata β€” Drupal integration via metadata.json
  3. Composability β€” Nesting, props, events, slots
  4. Styling β€” Scoped CSS, design tokens, theming
  5. Utilities β€” Helper functions and shared logic
  6. Data Fetching β€” Entity queries, views integration, API calls
  7. Upload β€” Deploying components to Drupal

Resources

  • Scaffolding: npx @drupal-canvas/create
  • Canvas Skills: npx skills add drupal-canvas/skills
  • Drupal Canvas Module: Available via Composer
  • Nebula Template: Included with @drupal-canvas/create

Source: SKILL.md on GitHub

No alerts16d4 checks Β· Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides safe documentation and installation instructions for the Drupal Canvas Code Components framework. It includes instructions for scaffolding a project and adding related development skills using standard commands.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW Β· No issues

  • ZeroLeaks5mo

    Score: 93/100 Β· 2 sections analyzed

Signed by skilld at 8d7463f. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 7 months ago

README badge

README badge for grasmash/drupal-claude-skills/drupal-canvas