Skip to content
Chat & AI

Tool

Server Component

Collapsible 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.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
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

Skip ToolLabels props table
PropTypeDefaultDescription
pending
string——
running
string——
completed
string——
error
string——
parameters
string——
result
string——
errorHeading
string——

ToolProps

Extends ComponentProps<typeof Collapsible>

Skip ToolProps props table
PropTypeDefaultDescription
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>

Skip ToolHeaderProps props table
PropTypeDefaultDescription
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>

Skip ToolContentProps props table
PropTypeDefaultDescription
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>

Skip ToolInputProps props table
PropTypeDefaultDescription
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>

Skip ToolOutputProps props table
PropTypeDefaultDescription
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.