Examples

Click → sidebar

Slide in a contextual panel. Same listener as the modal example, different placement — useful when option editing happens mid-flow without leaving the canvas.

Click any node
Webhook
Event: ticket.created
Plan answer
gpt-5.4-mini
Model: gpt-5.4-mini
Send reply
Channel: email

Click a node to load its options in the sidebar. Click empty canvas to close it.

tsx
import { useState } from "react";
import { WireProvider, WireCanvas, WireOptionPanel } from "@aigentive/wire-react";

function FlowWithSidebar({ diagram, options }) {
  const [openId, setOpenId] = useState<string>();

  return (
    <WireProvider
      defaultDiagram={diagram}
      onEvent={(event) => {
        if (event.type === "node.click") setOpenId(event.nodeId);
        else if (event.type === "pane.click") setOpenId(undefined);
      }}
    >
      <div className="grid grid-cols-[1fr_320px]">
        <WireCanvas mode="view" />
        {openId && (
          <aside>
            <WireOptionPanel catalog={options} nodeId={openId} />
          </aside>
        )}
      </div>
    </WireProvider>
  );
}