InlineToolCall
Hero example
When to use
Reach for InlineToolCall whenever an agent has invoked a Matter API tool and the user should see what API call happened. Canonical mount: inside an assistant message row, between the assistant's prose and any rendered InlineCard ("I've drafted the consent. [InlineToolCall: POST /resolutions · 201 · 412ms]. Here it is: [BoardConsentCard]"). The pill carries enough information to verify the call without expanding into a full tool-call detail view.
Don't reach for InlineToolCall for non-API events (use Pill or a Timeline atom), for top-level navigation chrome (use EndpointBadge instead — it's tuned for documentation surfaces, not chat history), or for batched calls. If the agent ran 30 tool calls in a loop, render a summary InlineToolCall and link to the audit log.
Anatomy
A single <div class="tool-call"> with four inline children:
- Status dot. 6×6 circle whose color resolves through
data-status.ok→ green,err→ red,pending→ amber.aria-hidden. - Method. Bold mono, the HTTP verb (
GET,POST,PATCH,DELETE, etc.). 11px, 0.04em letter-spacing. - Path. Regular mono, the API path (
/entities/ent_…). Truncates with ellipsis if it overflows the row. - Meta. Mono. The status label (
200 OK) plus a non-breaking·separator plus latency (412ms).
The whole pill is a single visual unit with no internal interactivity. If you need the tool-call to be clickable (open the audit-log detail), wrap it in an <a> or <button> at the consumer layer.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| methodrequired | string | — | — |
| pathrequired | string | — | — |
| statusLabel | string | "200 OK" | HTTP status code rendered as `200 OK`, `404 Not Found`, etc. |
| latency | string | "412ms" | Round-trip latency rendered after the status, e.g. "412ms". |
| status | InlineToolCallStatus | "ok" | Drives the dot color + ring. Defaults to "ok". |
| className | string | — | — |
| style | React.CSSProperties | — | — |
statusLabel defaults to "200 OK" and latency defaults to "412ms" — these are demo defaults; production usage always passes real values.
States
Three semantic states driven by status:
status | Dot color | When to use |
|---|---|---|
ok (default) | green | Tool call succeeded. Status code 2xx. |
err | red | Tool call failed. Status code 4xx or 5xx. |
pending | amber | Tool call is in flight. Dot pulses (collapses to static under reduced motion). |
There's no cancelled or timeout state — those resolve to err with an appropriate statusLabel ("408 Timeout", "499 Cancelled").
Density
In compact, the pill height drops from 22 to 18px and font size from 11px to 10px. The dot stays 6×6.
Themes
Tokens consumed
Dot color reads --status-green, --status-red, --status-amber based on data-status. Method bold reads --fg; path and meta read --fg-muted.
Accessibility
- Keyboard interactions. None — the pill is non-interactive.
- ARIA roles and properties. The dot is
aria-hidden. Thedata-statusattribute is CSS-only. The pill announces its full text content (method, path, statusLabel, latency). - Focus order. N/A.
- Screen-reader expectations. Reading order: "
{METHOD}{path},{statusLabel}·{latency}." Avoid prepending the dot — it'saria-hidden. - Reduced motion. The
pendingstate's dot pulse animation collapses to a static dot underprefers-reduced-motion: reduce. - Forced colors. Status dot collapses to
ButtonText. Method, path, and meta inherit system foreground. - WIG rules. Mono caps via 0.04em letter-spacing (WIG typography minimum). Non-breaking space
·separator between statusLabel and latency.aria-hiddenon the decorative dot.
Do / Don't
statusLabel strings ("200 OK", "404 Not Found"). The format is HTTP-canonical.status="pending" and an explicit statusLabel="Pending". The pulse plus the label is the contract.tool-call__path recipe (built into the styles). Use the full path in a tooltip or in the audit-log detail view.path. Path is the route shape, not the full URL.Recipes
This component appears in:
- Docs corpus recipe — inline tool-call breadcrumbs inside agent replies.
- Board recipe — the activity-stream sidebar.
- API recipe — examples of tool calls invoked from the playground.
Code example
import { InlineToolCall } from "@matter/components";
export function AgentReplyToolCalls({ events }: { events: ToolCallEvent[] }) {
return (
<div className="agent-reply-toolcalls">
{events.map((event) => (
<InlineToolCall
key={event.id}
method={event.method}
path={event.path}
status={event.outcome === "success" ? "ok" : event.outcome === "in_flight" ? "pending" : "err"}
statusLabel={event.status_display}
latency={event.latency_ms ? `${event.latency_ms}ms` : undefined}
/>
))}
</div>
);
}Source
packages/components/src/InlineCard/InlineToolCallComposerLensDefs
SVG defs chain that drives the Composer's Tahoe-glass backdrop refraction and chromatic-aberration rim. Two filters referenced from CSS — #composer-lens (full-rim displacement) and #composer-chroma (RGB shift). Mount once per page.
SlidingPill
Radix-free tab pill with an animated indicator that slides between items. Single absolute element reads the active item's offsetLeft + width — preserves the v2 liquid-glass settle-spring easing without a third-party state machine.