// Generated by scripts/generate-showcase.mjs. Do not edit directly. page DrawflowCanvasDetail { layout = "showcase" state playground_nodes = JSON.parse(ctx.url.searchParams.get("pg_nodes") ?? "[]") state playground_toolbar = (ctx.url.searchParams.get("pg_toolbar") ?? "true") === "true" state playground_class = ctx.url.searchParams.get("pg_class") ?? "showcase-instance showcase-instance--1" seo { title = "Drawflow Canvas" description = "Reusable drawflow canvas component." } view {
Core component

Drawflow Canvas

Reusable drawflow canvas component.

3 props0 slots4 outputsTheme readyResponsive
Interactive playground

Configure Drawflow Canvas

Change any prop and inspect the server-rendered component immediately.

Live preview
Component code
<DrawflowCanvas />
Event outputInteract with the preview to inspect the typed payload.
Component props3 controls
Live examples

Designed for real product surfaces

Compare configurations and resize the browser to check responsive behavior.

Recommended

Production default

Balanced spacing, hierarchy, and content for the most common product workflow.

01
Live preview
Component usage.wrn
<DrawflowCanvas />
Dense UI

Compact application

A tighter variation for dashboards, side panels, tables, and operational interfaces.

02
Live preview
Component usage.wrn
<DrawflowCanvas />
Extended

Rich configuration

A more expressive variation using additional data, stronger emphasis, and optional states.

03
Live preview
Component usage.wrn
<DrawflowCanvas />
Component outputs

Receive every typed component output

Use declarative output handlers in .wrn files or register a direct output handler from JavaScript. The canonical API exposes payload and does not require event.detail.

@selectFires when an item, option, card, or result is selected.
@connectFires when the component emits the connect event.
@moveFires when the component emits the move event.
@addFires when the component emits the add event.
Declarative handlers.wrn
<DrawflowCanvas
  @select='console.log(payload)'
  @connect='console.log(payload)'
  @move='console.log(payload)'
  @add='console.log(payload)'
/>
Direct output handlers.js
import { registerOutputHandler } from "@wrnexus/csr/outputs"

const component = document.querySelector("[data-ui-component=\"DrawflowCanvas\"], [data-component=\"DrawflowCanvas\"]")

if (component) registerOutputHandler(component, "select", (payload) => {
  console.log("select", payload)
})

if (component) registerOutputHandler(component, "connect", (payload) => {
  console.log("connect", payload)
})

if (component) registerOutputHandler(component, "move", (payload) => {
  console.log("move", payload)
})

if (component) registerOutputHandler(component, "add", (payload) => {
  console.log("add", payload)
})
Component API

Props and configuration

All content and behavior shown above is supplied through these props and slots.

PropTypeDefaultRequired
nodesstring[] palette=[] activeNode="" label="Workflow" arrangeLabel="Arrange nodes" connectLabel="Connect" color="primary" size="default"No
toolbarbooleantrueNo
classstring""No
} }