Getting Started
Components
- Agent Status
- Agent Template Card
- API Key Card
- Audio Player
- Bar Visualizer
- Channel Status Card
- Chat Composer
- Code Editor
- Condition Builder
- Confirm Dialog
- Conversation
- Conversation Bar
- Dataset Card
- Document Status Badge
- Extraction Strategy Select
- File Icon
- File Upload
- Indexing Progress
- Live Waveform
- Matrix
- Message
- Mic Selector
- Model Diff View
- Model Selector
- Model Type Filter
- Node Catalog
- Option Editor
- Orb
- Output Variables View
- Package Card
- Prompt Editor
- Provider Status Card
- Radio Card
- Resource Card
- Resource Sidebar
- Response
- Run Node List
- Scrub Bar
- Segment Card
- Shimmering Text
- Speech Input
- Token Trend Chart
- Tool Call Card
- Transcript Viewer
- Usage Stat Card
- Variable Binding Editor
- Variable Selector
- Voice Button
- Voice Picker
- Waveform
- Workflow Node Card
- Workspace Selector
Output variables
3intentenumThe detected support intent used for workflow routing.
"billing_question"
confidencenumberClassifier confidence from 0 to 1.
0.86
documentsarrayRetrieved knowledge chunks with citation metadata.
[{ "title": "Billing FAQ", "score": 0.91 }]import { OutputVariablesView } from "@/components/ui/output-variables-view"
const variables = [
{
name: "intent",
type: "enum",
description: "The detected support intent used for workflow routing.",
sample: `"billing_question"`,
},
{
name: "confidence",
type: "number",
description: "Classifier confidence from 0 to 1.",
sample: "0.86",
},
{
name: "documents",
type: "array",
description: "Retrieved knowledge chunks with citation metadata.",
sample: `[{ "title": "Billing FAQ", "score": 0.91 }]`,
},
]
export function OutputVariablesViewDemo() {
return (
<OutputVariablesView variables={variables} className="w-full max-w-xl" />
)
}
Installation
pnpm dlx shadcn@latest add https://ui.zgi.ai/r/output-variables-view.jsonpnpm dlx shadcn@latest add https://ui.zgi.ai/r/output-variables-view.json
yarn dlx shadcn@latest add https://ui.zgi.ai/r/output-variables-view.jsonComponent
"use client"
import * as React from "react"
import { cn } from "@/lib/utils"
import { Badge } from "@/components/ui/badge"
export interface OutputVariable {
name: React.ReactNode
type?: React.ReactNode
description?: React.ReactNode
sample?: React.ReactNode
}
export interface OutputVariablesViewProps
extends Omit<React.ComponentProps<"div">, "title"> {
variables: OutputVariable[]
title?: React.ReactNode
emptyText?: React.ReactNode
}
export function OutputVariablesView({
variables,
title = "Output variables",
emptyText = "No output variables.",
className,
...props
}: OutputVariablesViewProps) {
return (
<div
className={cn(
"border-border bg-card text-card-foreground overflow-hidden rounded-lg border shadow-sm",
className
)}
{...props}
>
<div className="border-border flex min-h-11 items-center justify-between border-b px-3">
<p className="text-sm font-medium">{title}</p>
<Badge variant="secondary" className="rounded-md">
{variables.length}
</Badge>
</div>
{variables.length ? (
<div className="divide-border divide-y">
{variables.map((variable, index) => (
<div key={index} className="grid gap-1.5 p-3">
<div className="flex min-w-0 items-center gap-2">
<code className="truncate font-mono text-sm">
{variable.name}
</code>
{variable.type ? (
<Badge variant="outline" className="h-6 rounded-md px-2">
{variable.type}
</Badge>
) : null}
</div>
{variable.description ? (
<p className="text-muted-foreground text-xs leading-5">
{variable.description}
</p>
) : null}
{variable.sample ? (
<pre className="bg-muted text-muted-foreground mt-1 overflow-auto rounded-md p-2 text-xs">
{variable.sample}
</pre>
) : null}
</div>
))}
</div>
) : (
<div className="text-muted-foreground p-6 text-center text-sm">
{emptyText}
</div>
)}
</div>
)
}
Usage
import { OutputVariablesView } from "@/components/ui/output-variables-view"
export function Example() {
return <OutputVariablesView variables={[{ name: "intent", type: "enum" }]} />
}Deploy and Scale Agents with ZGI
ZGI delivers the infrastructure and developer experience you need to ship reliable audio & agent applications at scale.
Talk to an expert