Tesserae

ToolCall

Description

Inline tool-call indicator that expands accordion-style to show the associated content. The content component is created lazily the first time the user expands the tool call. Used in chat / assistant UIs to surface tool invocations without taking up vertical space until expanded.

Usage

API reference

class

ToolCall

public sealed class ToolCall : ComponentBase<ToolCall, HTMLElement>

Inline tool-call indicator that expands accordion-style to show the associated content. The content component is created lazily the first time the user expands the tool call.

Constructors

Constructor
ToolCall
public ToolCall(UIcons icon, string text, Func<IComponent> contentFactory = null)

Initializes a new instance of this class.

Constructor
ToolCall
public ToolCall(UIcons icon, string text, IComponent content) : this(icon, text, content != null ? (Func<IComponent>)(() => content) : null)

Initializes a new instance of this class.

Properties

Property
ToolCall.Icon
public UIcons Icon

Gets or sets the icon shown by the component.

Property
ToolCall.Text
public string Text

Gets or sets the text shown in the component.

Property
ToolCall.IsExpanded
public bool IsExpanded

Gets or sets a value indicating whether the component is expanded.

Property
ToolCall.HasContent
public bool HasContent

Returns a value indicating whether the component has the given content.

Methods

Method
ToolCall.CreateContent
public IComponent CreateContent()

Returns a fresh IComponent built from the content factory, or null if no factory was provided. Used by to render the detail pane independently of this inline view.

Method
ToolCall.SetContent
public ToolCall SetContent(Func<IComponent> contentFactory)

Sets the content of the component.

Method
ToolCall.SetContent
public ToolCall SetContent(IComponent content)

Sets the content of the component.

Method
ToolCall.SetText
public ToolCall SetText(string text)

Sets the text of the component.

Method
ToolCall.SetIcon
public ToolCall SetIcon(UIcons icon)

Sets the icon of the component.

Method
ToolCall.NotExpandable
public ToolCall NotExpandable()

Configures the not expandable on the component.

Method
ToolCall.Expanded
public ToolCall Expanded(bool value = true)

Expands the component.

Method
ToolCall.Expand
public ToolCall Expand()

Expands the component.

Method
ToolCall.Collapse
public ToolCall Collapse()

Collapses the component.

Method
ToolCall.Toggle
public ToolCall Toggle()

Toggles the component's state.

Method
ToolCall.OnToggle
public ToolCall OnToggle(Action<ToolCall> onToggle)

Registers a callback invoked when the toggle event fires.

Method
ToolCall.Render
public override HTMLElement Render()

Renders the component's root HTML element.

class

ToolsUsed

public sealed class ToolsUsed : ComponentBase<ToolsUsed, HTMLElement>

Compact summary of multiple tool calls that opens a popup showing the list of tools on the left. Clicking a tool slides the list to the left and shows that tool's content on the right with a back button to return to the list.

Constructors

Constructor
ToolsUsed
public ToolsUsed(IEnumerable<ToolCall> tools = null)

Initializes a new instance of this class.

Methods

Method
ToolsUsed.Add
public ToolsUsed Add(ToolCall tool)

Adds the given item to the component.

Method
ToolsUsed.AddRange
public ToolsUsed AddRange(IEnumerable<ToolCall> tools)

Adds the given range to the component.

Method
ToolsUsed.Add
public ToolsUsed Add(UIcons icon, string text, Func<IComponent> contentFactory)

Adds the given item to the component.

Method
ToolsUsed.Add
public ToolsUsed Add(UIcons icon, string text, IComponent content)

Adds the given item to the component.

Method
ToolsUsed.Clear
public ToolsUsed Clear()

Clears the component's current state.

Method
ToolsUsed.SetSummary
public ToolsUsed SetSummary(string label)

Sets the summary of the component.

Method
ToolsUsed.SetIcon
public ToolsUsed SetIcon(UIcons icon)

Sets the icon of the component.

Method
ToolsUsed.SetTitle
public ToolsUsed SetTitle(string title)

Sets the title of the component.

Method
ToolsUsed.Show
public ToolsUsed Show()

Shows the component.

Method
ToolsUsed.Hide
public ToolsUsed Hide()

Hides the component.

Method
ToolsUsed.Render
public override HTMLElement Render()

Renders the component's root HTML element.

See also

© 2026 Tesserae. All rights reserved.