Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Autocomplete
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Checkbox Group
- Collapsible
- Combobox
- Command
- Context Menu
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Fieldset
- Form
- Frame
- Group
- Input
- Input Group
- Kbd
- Label
- Menu
- Menubar
- Message
- Meter
- Number Field
- OTP Field
- Pagination
- Popover
- Preview Card
- Progress
- Questionnaire
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Toolbar
- Tooltip
Shared
- Artifact
- Audio Player
- Canvas
- Chain of Thought
- Checkpoint
- Code Block
- Commit
- Connection
- Context
- Controls
- Edge
- Environment Variables
- Mic Selector
- Model Selector
- Node
- Node Toolbar
- Open in Chat
- Panel
- Plan
- Prompt Input
- Queue
- Reasoning
- Sandbox
- Schema Display
- Shimmer
- Snippet
- Sources
- Speech Input
- Stack Trace
- Suggestion
- Tool
- Transcription
- Web Preview
Hooks
Resources
Controls
Zoom and fit controls for the canvas.
Extract
Reads records from the source
Runs on every incoming batch.
Transform
Maps records to the output schema
Runs on every incoming batch.
Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.
"use client";
import { Canvas } from "@/registry/default/shared/canvas";
import { Controls } from "@/registry/default/shared/controls";
import {
Node,
NodeContent,
NodeDescription,
NodeHeader,
NodeTitle,
} from "@/registry/default/shared/node";
function DemoNode({ data }: { data: { description: string; title: string } }) {
return (
<Node handles={{ source: true, target: true }}>
<NodeHeader>
<NodeTitle>{data.title}</NodeTitle>
<NodeDescription>{data.description}</NodeDescription>
</NodeHeader>
<NodeContent>
<p className="text-sm">Runs on every incoming batch.</p>
</NodeContent>
</Node>
);
}
const nodeTypes = { demo: DemoNode };
const nodes = [
{
data: { description: "Reads records from the source", title: "Extract" },
id: "extract",
position: { x: 0, y: 0 },
type: "demo",
},
{
data: {
description: "Maps records to the output schema",
title: "Transform",
},
id: "transform",
position: { x: 480, y: 0 },
type: "demo",
},
];
const edges = [{ id: "extract-transform", source: "extract", target: "transform" }];
export default function Particle() {
return (
<div className="h-80 w-full">
<Canvas edges={edges} nodes={nodes} nodeTypes={nodeTypes}>
<Controls />
</Canvas>
</div>
);
}
Installation
pnpm dlx shadcn@latest add @frontal-labs/controls
Usage
import { Controls } from "@/components/controls";API Reference
| Export | Props |
|---|---|
Controls | ControlsPrimitive props |
Open the source under Manual above for the exact prop types.
On This Page