Overview
Interactable components persist on screen and can be updated by the AI through natural language requests. Unlike regular generative components that render once per message, interactable components:- Remain visible across multiple messages
- Update in place when the AI modifies them
- Maintain state that the AI can read and update
- Support refinement through conversational iteration
Creating Interactable Components
Use thewithTamboInteractable() HOC to make any component interactable:
InteractableConfig
The configuration object passed towithTamboInteractable() defines how the AI can interact with the component:
Component Name
Unique identifier for this component type. Should be descriptive and unique across your app:Description
Explains to the AI what this component does and when to update it:Props Schema
Defines which props the AI can update. Only serializable props (strings, numbers, booleans, arrays, objects) can be tracked:State Schema
Defines internal state that the AI can read and modify independently from props:Props vs State
Interactable components separate props (external data) from state (internal data):Props
- Passed from parent component
- Updated by AI through tool calls
- Controlled by external data
State
Managed internally usinguseTamboComponentState() hook:
Auto-Registered Tools
When you create an interactable component, Tambo automatically registers two tools for the AI:1. Update Props Tool
Allows the AI to update component props:update_Note_props({ title: "Important" })
2. Update State Tool
Allows the AI to update component state:update_Note_state({ isPinned: true })
WithTamboInteractableProps
The HOC injects additional props you can use:Component State Management
UseuseTamboComponentState() inside your component to create AI-readable state:
[0]- Current state value[1]- Setter function[2]- Metadata object withisPendingflag
Streaming Updates
By default, prop and state updates stream in real-time. Disable streaming for specific components:Multiple Instances
You can render multiple instances of the same interactable component. Each gets a unique ID:Best Practices
Keep State Minimal
Only expose state that the AI should control:Provide Clear Descriptions
Help the AI understand what updates are possible:Handle Loading States
Show feedback during AI updates:Use Schemas for Validation
Validate updates with schema constraints:Lifecycle
- Mount - Component renders with initial props
- Registration - HOC registers component with unique ID
- Tool Creation - Update tools are registered with AI
- Updates - AI can call update tools to modify props/state
- Unmount - Component cleanup (tools remain available)
Next Steps
- Learn about Component State for streaming updates
- Explore Tools to understand the underlying tool system
- See Generative UI for the broader context
- Check Components for basic component concepts