Visualize Text Node
simple-ai/visualize-text-nodeFreeComponent
A React Flow node component for displaying text content with Markdown support and a resizable interface.
Live preview
live · rendered by the registry
Rendered by simple-ai on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://simple-ai.dev/r/visualize-text-node.jsonSource
1import { type Node, type NodeProps, Position } from "@xyflow/react";2import { Eye, Trash } from "lucide-react";3import { Separator } from "@/components/ui/separator";4import { cn } from "@/lib/utils";5import { LabeledHandle } from "@/registry/ui/flow/labeled-handle";6import {7 NodeHeader,8 NodeHeaderAction,9 NodeHeaderActions,10 NodeHeaderIcon,11 NodeHeaderTitle,12} from "@/registry/ui/flow/node-header";13import { ResizableNode } from "@/registry/ui/flow/resizable-node";14import { MarkdownContent } from "@/registry/ui/markdown-content";1516export type VisualizeTextNode = Node<17 {18 status: "processing" | "error" | "success" | "idle" | undefined;19 input: string | undefined;20 },21 "visualize-text"22>;2324interface VisualizeTextProps extends NodeProps<VisualizeTextNode> {25 onDeleteNode?: () => void;26}2728export function VisualizeTextNode({29 selected,30 data,31 onDeleteNode,32}: VisualizeTextProps) {33 return (34 <ResizableNode35 selected={selected}36 className={cn("flex flex-col", {37 "border-orange-500": data.status === "processing",38 "border-red-500": data.status === "error",39 })}40 >41 <NodeHeader className="m-0">42 <NodeHeaderIcon>43 <Eye />44 </NodeHeaderIcon>45 <NodeHeaderTitle>Visualize Text</NodeHeaderTitle>46 <NodeHeaderActions>47 <NodeHeaderAction48 onClick={onDeleteNode}49 variant="ghost"50 label="Delete node"51 >52 <Trash />53 </NodeHeaderAction>54 </NodeHeaderActions>55 </NodeHeader>56 <Separator />57 <div className="p-2 flex-1 overflow-auto flex flex-col">58 <div className="flex-1 overflow-auto nodrag nopan nowheel border border-border rounded-md p-2 select-text cursor-auto">59 <MarkdownContent60 content={data.input ? data.input : "No text to display"}61 />62 </div>63 </div>64 <div className="flex justify-start pt-2 pb-4 text-sm">65 <LabeledHandle66 id="input"67 title="Input"68 type="target"69 position={Position.Left}70 />71 </div>72 </ResizableNode>73 );74}
What it pulls in
npm packages
Other registry items
Files it writes
More from simple-ai
All 77 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| base-handlebase-handle | simple-ai | Components | Free | 1 dep | |
| base-nodebase-node | simple-ai | Components | Free | no deps | |
| Chat Inputchat-input | simple-ai | Components | Free | 7 deps | |
| Chat Messagechat-message | simple-ai | Components | Free | no deps | |
| Chat Message Areachat-message-area | simple-ai | Components | Free | 1 dep | |
| Chat Suggestionschat-suggestions | simple-ai | Components | Free | no deps | |
| Editable Handleeditable-handle | simple-ai | Components | Free | 1 dep | |
| Generate Text Nodegenerate-text-node | simple-ai | Components | Free | 1 dep |
