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.

Namespace
Tesserae
Inheritance
ComponentBase<ToolCall, HTMLElement> → ToolCall

Constructors

NameDescription
ToolCallInitializes a new instance of this class.
Constructor
ToolCall
Overload
ToolCall(UIcons, string, Func<IComponent>)Initializes a new instance of this class.
ToolCall(UIcons, string, IComponent)Initializes a new instance of this class.
ToolCall(UIcons, string, Func<IComponent>)
public ToolCall(UIcons icon, string text, Func<IComponent> contentFactory = null)

Initializes a new instance of this class.

Parameters

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

Initializes a new instance of this class.

Parameters

icon UIcons
text string
content IComponent

Properties

NameDescription
IconGets or sets the icon shown by the component.
TextGets or sets the text shown in the component.
IsExpandedGets or sets a value indicating whether the component is expanded.
HasContentReturns a value indicating whether the component has the given content.
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

NameDescription
CreateContentReturns a fresh IComponent built from the content factory, or null if no factory was provided. Used by ToolsUsed to render the detail pane independently of this inline view.
SetContentSets the content of the component.
SetTextSets the text of the component.
SetIconSets the icon of the component.
NotExpandableConfigures the not expandable on the component.
ExpandedExpands the component.
ExpandExpands the component.
CollapseCollapses the component.
ToggleToggles the component's state.
OnToggleRegisters a callback invoked when the toggle event fires.
RenderRenders the component's root HTML element.
Method
ToolCall.CreateContent
public IComponent CreateContent()

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

Method
ToolCall.SetContent
Overload
SetContent(Func<IComponent>)Sets the content of the component.
SetContent(IComponent)Sets the content of the component.
SetContent(Func<IComponent>)
public ToolCall SetContent(Func<IComponent> contentFactory)

Sets the content of the component.

Parameters

contentFactory Func<IComponent>
SetContent(IComponent)
public ToolCall SetContent(IComponent content)

Sets the content of the component.

Parameters

content IComponent
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.

Namespace
Tesserae
Inheritance
ComponentBase<ToolsUsed, HTMLElement> → ToolsUsed

Constructors

NameDescription
ToolsUsedInitializes a new instance of this class.
Constructor
ToolsUsed
public ToolsUsed(IEnumerable<ToolCall> tools = null)

Initializes a new instance of this class.

Methods

NameDescription
AddAdds the given item to the component.
AddRangeAdds the given range to the component.
ClearClears the component's current state.
SetSummarySets the summary of the component.
SetIconSets the icon of the component.
SetTitleSets the title of the component.
ShowShows the component.
HideHides the component.
RenderRenders the component's root HTML element.
Method
ToolsUsed.Add
Overload
Add(ToolCall)Adds the given item to the component.
Add(UIcons, string, Func<IComponent>)Adds the given item to the component.
Add(UIcons, string, IComponent)Adds the given item to the component.
Add(ToolCall)
public ToolsUsed Add(ToolCall tool)

Adds the given item to the component.

Parameters

tool ToolCall
Add(UIcons, string, Func<IComponent>)
public ToolsUsed Add(UIcons icon, string text, Func<IComponent> contentFactory)

Adds the given item to the component.

Parameters

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

Adds the given item to the component.

Parameters

icon UIcons
text string
content IComponent
Method
ToolsUsed.AddRange
public ToolsUsed AddRange(IEnumerable<ToolCall> tools)

Adds the given range 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 Curiosity. All rights reserved.