Skip to content
Velkin LogoVelkin Logo
Velkin
VELKIN/UI

Modern UI components for product teams and their AI agents. Lit core, typed wrappers, live MCP.

sales@velkinui.com

Product

  • Docs
  • Components
  • Studio
  • Pricing

Resources

  • Quick start
  • Blog
  • Changelog
  • Roadmap
  • Status

Project

  • About
  • Contact
  • License
  • Privacy
  • Terms

© 2026 Velkin. MIT core · Pro licenses available.

VELKIN

Flow

Pro

A flow diagram component with nodes, edges, pan, zoom, and selection.

vu-flow · @velkin/react-pro/flow

Copy page

Import

React
npm i @velkin/react-pro

import { LicenseInfo } from "@velkin/license";
// Vite: import.meta.env.VITE_VELKIN_LICENSE_KEY
// Next: process.env.NEXT_PUBLIC_VELKIN_LICENSE_KEY
LicenseInfo.setLicenseKey(import.meta.env.VITE_VELKIN_LICENSE_KEY ?? process.env.NEXT_PUBLIC_VELKIN_LICENSE_KEY ?? "");

// @velkin-pro
import { VuFlow } from "@velkin/react-pro/flow";

Examples

API

Tables match the member selected under Import.

Props

PropTypeDefaultDescription
nodesVuFlowNodeModel[][]Graph nodes.
edgesVuFlowEdgeModel[][]Graph edges.
autofitLivebooleanfalseFit view when content changes. Default: `false`.
lockedbooleanfalseDisables pan, drag, and connect. Default: `false`.
withControlsbooleanfalseShows zoom/fit/lock controls. Default: `false`.
withMiniMapbooleanfalseShows navigation minimap. Default: `false`.
virtualizeThresholdnumber0Virtualize nodes above this count; `0` disables.

Events

EventDetailDescription
vu-selectVuFlowSelectDetailSelection changed.
vu-dragVuFlowDragDetailNode drag phase (`start`/`move`/`end`).
vu-node-addVuFlowNodeAddDetailNode added via `addNode()`.
vu-connectVuFlowConnectDetailConnect gesture or edge create.
vu-contextVuFlowContextDetailRight-click; call `preventDefault()` to suppress built-in menu.

Slots

SlotDescription
—- `<vu-flow-node>` and `<vu-flow-edge-overlay>` children.
context-menuPrefer `<vu-flow-context-menu>`; custom content also works.

CSS parts

PartDescription
baseGrab/pan surface.
nodesNode layer host.
poolReserved (culling is in-place; kept for API stability).
overlaysEdge-overlay layer host.
controlsZoom/fit/lock controls cluster.
minimapMinimap panel.
context-menuContext menu panel.

Methods

MethodDescription
fitView- Fit all nodes into the viewport.
zoomIn- Zoom in one step.
zoomOut- Zoom out one step.
setLocked- Toggle or set the locked state.
addNode- Add a node and fire `vu-node-add`.
addEdge- Add an edge and fire `vu-connect`.
deleteSelected- Remove selected nodes/edges from the graph.
clearSelection- Clear the current selection.
getSelection- Return currently selected nodes and edges.
autoLayout- Run layered layout (topo + barycentric) and animate node positions.

Types

NameDefinition
VuFlowConnectDetail
{
  phase: VuFlowGesturePhase;
  sourceId: string;
  sourceSide: VuFlowSide | null;
  targetId?: string | null;
  targetSide?: VuFlowSide | null;
  valid?: boolean;
  created?: boolean;
  edge?: VuFlowEdgeModel;
  reason?: string;
  x?: number;
  y?: number;
}
VuFlowContextDetail
{
  target: VuFlowContextTarget;
  clientX: number;
  clientY: number;
  graphX: number;
  graphY: number;
  node?: VuFlowNodeModel;
  edge?: VuFlowEdgeModel;
  nodes: VuFlowNodeModel[];
  edges: VuFlowEdgeModel[];
}
VuFlowDragDetail
{
  phase: VuFlowGesturePhase;
  node: VuFlowNodeModel;
  event?: MouseEvent;
}
VuFlowNodeAddDetail
{ node: VuFlowNodeModel; }
VuFlowSelectDetail
{ nodes: VuFlowNodeModel[]; edges: VuFlowEdgeModel[]; }

Related

Companions

  • Flow Context Menu`vu-flow-context-menu`
  • Flow Edge Overlay`vu-flow-edge-overlay`
  • Flow Node`vu-flow-node`
  • Flow Toolbar`vu-flow-toolbar`

Data display

  • AvatarAn avatar component with image, initials, icon, or custom content.
  • Avatar GroupAn avatar group component that stacks overlapping avatars.
  • BadgeA badge component for counts, status dots, and overlay marks.
  • ChipA chip component for tags and filters with dismiss or toggle actions.
  • Data TableA data table component with sorting, filtering, and selection.
  • DividerA divider component for horizontal or vertical layout separation.

Guides

  • Pro licenseLicenseInfo and Pro imports
  • AppearanceShared visual props
  • EventsSelection and change events

Browse

  • Previous: File ViewerEarlier in the sidebar
  • Next: IconLater in the sidebar
  • All componentsBrowse the full index