Canonical definition
A Canvas component is a package of:
- •A React implementation (
index.jsx) - •Canvas metadata/schema (
component.yml) - •Naming and structure compatibility (
machineName, folder path, story path) - •Canvas-compatible props/slots modeling
All four parts are required for the component to be usable in Drupal Canvas.
Minimum contract (MUST)
Every Canvas component MUST satisfy all checks below:
- •Component folder exists at
<components-root>/<machine-name>/(use the repository's configured components root, which may be defined in.env) - •React implementation exists at
<components-root>/<machine-name>/index.jsx - •Metadata exists at
<components-root>/<machine-name>/component.yml - •
component.ymlincludes required top-level keys (name,machineName,status,required,props,slots) - •Folder name exactly matches
machineNameincomponent.yml(kebab-case) - •A matching story exists at
<stories-root>/<machine-name>.stories.jsx(use the repository's configured stories root) - •Props/slots follow Canvas rules (for example, avoid unsupported array-of-object prop shapes; use slots for repeatable complex content)
If any item is missing, the component is incomplete for Canvas usage.