Example 1 - Code Component in Drupal Backend Only

Declaring code component & Make it available as a component: (*example copied from tailwind play)

2026-10-13T142714

Consuming code component in Canvas Page (for your landing page OR panel page presumably):

2026-10-13T150146

Consuming code component in Content Type template (each view mode have its own template), and consume the content type template in a View Block:

2026-10-13T143200

2026-10-13T145909

Example 2 -

Canvas CLI Setup:

once successfully configured you should be able to login your canvas cli via running npx canvas login

2026-10-13T155727

(*you can find about details on how to setup Canvas CLI with OAuth in the following links:

2026-10-13T162104

Pull component store in backend to local codebase:

First, like in example-1, declare the component in the backend:

2026-10-13T160430

Second, use the npx canvas pull command to pull it to your local

2026-10-13T160851

Push component store in local codebase to backend:

First, create the component in your codebase, and use npx canvas push command to push it

2026-10-13T161727

Second, see changes happening in Canvas:

2026-10-13T161950

Reference