Aurora AI Canvas
aurora-dinglebear-ai/aurora-ai-canvasFreeBlock
Aurora-native flow canvas with node edges and compact zoom actions.
Install it
npx shadcn@latest add https://aurora.dinglebear.ai/r/aurora-ai-canvas.jsonSource
1"use client"23import * as React from "react"4import { Minus, Plus } from "lucide-react"5import { Action } from "./action"6import { cn } from "@/lib/utils"78/* ------------------------------------------------------------------ *9 * Aurora · Canvas (AI element)10 *11 * A flow canvas with a header chip (status dot + title), a node-count12 * badge, a dotted-grid surface, absolutely-positioned nodes carrying13 * cyan input ports (left) + rose output ports (right), cyan bezier14 * edges that follow the nodes, and a zoom toolbar.15 *16 * Architecture (forwardRef, displayName, compound Node, HTMLAttributes17 * passthrough) is kept from the Aurora registry, while controls and typography18 * follow Aurora tokens and primitives.19 * ------------------------------------------------------------------ */2021type CanvasStatus = "running" | "idle" | "blocked"2223export interface CanvasEdge {24 /** index of the source Node child */25 from: number26 /** index of the target Node child */27 to: number28}2930export interface CanvasProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {31 title?: React.ReactNode32 status?: CanvasStatus33 /** edges drawn between Node children, by child index */34 edges?: CanvasEdge[]35}3637export interface NodeProps extends React.HTMLAttributes<HTMLDivElement> {38 title: string39 description?: string40}4142const statusGlow: Record<CanvasStatus, { dot: string; glow: string }> = {43 running: {44 dot: "var(--aurora-accent-primary)",45 glow: "0 0 0 3px color-mix(in srgb, var(--aurora-accent-primary) 22%, transparent), 0 0 12px color-mix(in srgb, var(--aurora-accent-primary) 60%, transparent)",46 },47 idle: {48 dot: "var(--aurora-text-muted)",49 glow: "0 0 0 3px color-mix(in srgb, var(--aurora-text-muted) 18%, transparent)",50 },51 blocked: {52 dot: "var(--axon-orange)",53 glow: "0 0 0 3px color-mix(in srgb, var(--axon-orange) 22%, transparent), 0 0 12px color-mix(in srgb, var(--axon-orange) 55%, transparent)",54 },55}5657/* Geometry parsed from a Node child's inline style. Nodes are positioned with58 * absolute left/top + a fixed width; height is estimated from the node card59 * chrome so edges can anchor to the vertical port center. */60type NodeBox = { left: number; top: number; width: number; height: number }6162const NODE_HEIGHT = 6463const PORT = 126465function parseLen(value: string | number | undefined, fallback: number): number {66 if (typeof value === "number") return value67 if (typeof value === "string") {68 const n = parseFloat(value)69// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from aurora
All 176 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Aurora AI Actionaurora-ai-action | aurora | Blocks | Free | 1 dep | |
| Aurora AI Actionsaurora-ai-actions | aurora | Blocks | Free | 1 dep | |
| Aurora AI Agentaurora-ai-agent | aurora | Blocks | Free | 1 dep | |
| Aurora AI Image Gridaurora-ai-ai-image-grid | aurora | Blocks | Free | 1 dep | |
| Aurora AI Attachmentsaurora-ai-attachments | aurora | Blocks | Free | 1 dep | |
| Aurora AI Audio Playeraurora-ai-audio-player | aurora | Blocks | Free | 1 dep | |
| Aurora AI Branchaurora-ai-branch | aurora | Blocks | Free | 1 dep | |
| Aurora AI Chain of Thoughtaurora-ai-chain-of-thought | aurora | Blocks | Free | 1 dep |
