Agent graph
Agent workflow graph that plays a run from lead agent to planner, three parallel agents and a reviewer, with light along live edges.
Demo data
The agent graph, its labels and the run timings (partly random) are invented; only label and autoplay can be set. It cannot show your own data yet, so use it as a template: replace the invented data in its source before it shows anything real. See Your data.
Playground
Change a prop and the component updates. Props marked live animate to the new value; the others rebuild the element.
<HfGraph label="Ultracode workflow" />
Installation
pnpm dlx shadcn@latest add @lumesec/hf-graphFirst timeRegister the @lumesec registry once, or install by URL
Adds @lumesec to your components.json:
pnpm dlx shadcn@latest registry add @lumesec=https://elements.lumesec.ai/r/{name}.jsonOr skip the setup and install by URL:
npx shadcn@latest add https://elements.lumesec.ai/r/hf-graph.jsonUsage
import { HfGraph } from "@/components/lumesec/hf-graph";
export function Example() {
return (
<HfGraph />
);
}Behaviour
Ultracode’s lead agent hands off to a planner, three agents in parallel and a reviewer. Live edges stream light with packets, running nodes get a comet halo, and narrow screens switch to a vertical layout.
API reference
Attributes
labelReact proplabelTypestringDefaultUltracode workflowHeading text. Observed.
autoplayReact propautoplayTypebooleanDefaultfalsePresence attribute. Starts a run 800 ms after the element connects.
Events
Events bubble and cross the shadow boundary unless the description says otherwise.
doneReact proponDoneDetail{}Fires when the reviewer finishes a run.
Methods
Call them on the element, for example through a React ref.
run(): Promise<void>Plays one simulated run of about five seconds and resolves when it ends. Calls during a run return at once and do nothing.
Accessibility
- The status next to the heading is an
aria-live="polite"region with messages such asOrchestrating,3 agents in parallelandDone in 5.1s. - Node labels are text. Their running and done states are shown by colour and a
data-sattribute, and read out through visually hidden text after the label (, running,, done). - The Run button has
aria-disabled="true"during a run and ignores presses; it stays focusable, so keyboard focus is kept. - Edges, packets and halos are drawn on an
aria-hiddencanvas. - Reduced motion: each step waits 60 ms so a run finishes almost at once, and no packets travel along live edges.
Theming
The element reads your shadcn theme tokens through its shadow root, so light and dark follow your theme. The accent comes from --lumesec. See Theming.
This component reads --border, --card, --foreground, --lumesec, --lumesec-success and --muted-foreground.
To restyle only LumeSec elements, set the matching --ui-* overrides: --ui-accent, --ui-border, --ui-fg, --ui-mono, --ui-muted, --ui-ok and --ui-surface.
Notes
- The graph, labels and timings are built-in demo data; step durations include some randomness.
- Below 520px of host width the layout switches to vertical and the stage grows from 196px to 262px tall.
Related
Was this page helpful?