Tool
Server ComponentCollapsible tool-call panel with input, output, and status.
Import
tsx
import { Tool } from "@cronus-ui/ui";
bash
npx cronus-ui add tool
Examples
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
default.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component ToolDefault layout:inline style:tool {
type:"tool-web-search"
state:"output-error"
errorText:"Request timed out after 30s"
label "default"
}
page "/audit/tool/default" type:custom {
use ToolDefault
}
API Reference
Generated from the component's exported types.
ToolLabels
| Prop | Type | Default | Description |
|---|---|---|---|
pending | string | — | — |
running | string | — | — |
completed | string | — | — |
error | string | — | — |
parameters | string | — | — |
result | string | — | — |
errorHeading | string | — | — |
ToolProps
Extends ComponentProps<typeof Collapsible>
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | — | Controlled open state. |
defaultOpen | boolean | — | Uncontrolled initial open state. |
onOpenChange | (open: boolean) => void | — | Called when the open state changes. |
children | ReactNode | — | Contents of the component. |
disabled | boolean | — | Disables pointer and keyboard interaction. |
ToolHeaderProps
Extends HTMLAttributes<HTMLButtonElement>
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | — | — |
type* | ToolUIPart["type"] | — | — |
state* | ToolUIPart["state"] | — | — |
labels | ToolLabels | — | Override default English strings. |
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |
ToolContentProps
Extends ComponentProps<typeof CollapsibleContent>
| Prop | Type | Default | Description |
|---|---|---|---|
forceMount | boolean | — | Keep the node mounted when closed, for exit animation. |
asChild | boolean | — | Render as the child element via Slot. |
children | ReactNode | — | Contents of the component. |
className | string | — | Additional class names merged onto the root. |
ToolInputProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
input* | ToolUIPart["input"] | — | — |
labels | Pick<ToolLabels, "parameters"> | — | Override default English strings. |
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |
ToolOutputProps
Extends HTMLAttributes<HTMLDivElement>
| Prop | Type | Default | Description |
|---|---|---|---|
output* | ToolUIPart["output"] | — | — |
errorText | ToolUIPart["errorText"] | — | — |
labels | Pick<ToolLabels, "result" | "errorHeading"> | — | Override default English strings. |
className | string | — | Additional class names merged onto the root. |
children | ReactNode | — | Contents of the component. |
id | string | — | DOM id of the root element. |