Usage
Chat Tool Calls presents function or tool activity within the Chat family. Set the calls JavaScript property to an ordered array and use stable key values while streaming updates.
import "@nordhealth/components/lib/ChatToolCalls"
Composition
Chat Tool Calls renders an ordered snapshot of consumer-provided call records. One call remains inline, while multiple calls share a disclosure; stable keys and status, statistics, and result fields preserve each call’s identity as streaming updates arrive.
Examples
Calls and disclosure
One call stays inline; multiple calls use a summary disclosure which surfaces the latest activity. Statuses are pending, running, complete, error, and unknown. Renderable statistics and result detail accept DOM nodes or primitive text/number values, never framework-owned render values.
Use default-open for initial uncontrolled expansion. For controlled behavior, set open and echo the proposed value from nord-toggle; the event includes the call key when a single call owns the disclosure.
Accessibility
The trigger exposes expanded state and controls a labelled detail region. Statuses include visible wording and symbols, errors remain text-visible, and completion metadata uses Nord readable text roles so meaning survives forced colors. Consumer nodes retain identity, listeners, state, and order across updates.
Templates
See this component composed into complete application views:
API reference
ChatToolCalls
Displays ordered LLM tool or function calls. One call stays inline; multiple
calls use a summary disclosure whose collapsed surface includes the latest
activity. Result nodes remain consumer-owned and are never scoped or cloned.
Prefer stable key values during streaming, provide a useful target, show
durations only after completion, and include visible errorMessage text.
Consumers localize fixed status/summary strings through Nord translations.
<nord-chat-tool-calls></nord-chat-tool-calls>Props
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
open | open | Controlled expansion state for the group, or for a single call's detail. | boolean | undefined | — |
defaultOpen | default-open | Initial expansion state when open is not controlled. | boolean | false |
label | label | Optional localized summary label for a group. | string | undefined | — |
| Event | Detail Type | Description |
|---|---|---|
nord-toggle | ChatToolCallsToggleEvent | Reports the next expansion state. In controlled mode the consumer must echo open back. |
CSS Properties
CSS Custom Properties provide more fine grain control over component presentation. We advise utilizing existing properties on the component before using these.
| Property | Description | Default |
|---|---|---|
--n-chat-tool-calls-surface | Disclosure surface color. | var(--n-color-surface-raised) |
--n-chat-tool-calls-border-color | Disclosure border color. | var(--n-color-border) |
Dependencies
This component is internally dependent on the following components:
- <nord-badge>
Badge
Badges are used to inform users of the status of an object or of an action that’s been taken. Commonly used in tabular data to indicate status.
- <nord-collapsible>
Collapsible
Collapsible is a disclosure that shows or hides a section of content. It wires together a Collapsible Trigger and a Collapsible Panel, animating the panel height as it opens and closes.
- <nord-icon>
Icon
Icons are used to provide additional meaning or in places where text label doesn’t fit. Icon component allows you to display an icon from the Nordicons library.
- <nord-spinner>
Spinner
Spinner component is used to indicate users that their action is being processed. You can customize the size and color of the spinner with the provided properties.