# ToolFallback
URL: /docs/ui/tool-fallback
Default UI component for tools without dedicated custom renderers.
Getting Started \[#getting-started]
Add `tool-fallback` \[#add-tool-fallback]
This adds a `/components/assistant-ui/tool-fallback.tsx` file to your project, which you can adjust as needed.
Use it in your application \[#use-it-in-your-application]
Pass the `ToolFallback` component to the `MessagePrimitive.Parts` component
```tsx title="/components/assistant-ui/thread.tsx" {1,9}
import { ToolFallback } from "@/components/assistant-ui/tool-fallback";
const AssistantMessage = () => {
return (
{({ part }) => {
if (part.type === "tool-call") return ;
return null;
}}
);
};
```
Examples \[#examples]
Streaming Demo \[#streaming-demo]
Interactive demo showing the full tool call lifecycle: running → complete.
Running State \[#running-state]
Shows a loading spinner and shimmer animation while the tool is executing.
Cancelled State \[#cancelled-state]
Shows a muted appearance when a tool call was cancelled.
Composable API \[#composable-api]
All sub-components are exported for custom layouts:
| Component | Description |
| ---------------------- | ----------------------------------------------- |
| `ToolFallback.Root` | Collapsible container with scroll lock |
| `ToolFallback.Trigger` | Header with tool name, status icon, and shimmer |
| `ToolFallback.Content` | Animated collapsible content wrapper |
| `ToolFallback.Args` | Displays tool arguments |
| `ToolFallback.Result` | Displays tool execution result |
| `ToolFallback.Error` | Displays error or cancellation messages |
```tsx
import {
ToolFallback,
ToolFallbackRoot,
ToolFallbackTrigger,
ToolFallbackContent,
ToolFallbackArgs,
ToolFallbackResult,
ToolFallbackError,
} from "@/components/assistant-ui/tool-fallback";
// Compound component syntax
```
Related Components \[#related-components]
* [ToolGroup](/docs/ui/tool-group) - Group consecutive tool calls together