TheDocumentation Index
Fetch the complete documentation index at: https://docs.mcp-use.com/llms.txt
Use this file to discover all available pages before exploring further.
<WidgetControls /> component adds control buttons for widget debugging and view controls (fullscreen/pip). It combines debug button and view controls with shared hover logic, making it easy to add development and testing capabilities to your widgets.
Import
Props
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | required | The widget content to wrap |
debugger | boolean | false | Enable debug button to display widget debug information |
viewControls | boolean | "pip" | "fullscreen" | false | Enable view controls. true = both pip and fullscreen, "pip" = only pip, "fullscreen" = only fullscreen |
position | "top-left" | "top-center" | "top-right" | "center-left" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right" | "top-right" | Position of the control buttons |
attachTo | HTMLElement | null | undefined | Element to attach controls to (for custom positioning) |
showLabels | boolean | true | Show labels on control buttons |
className | string | "" | Additional CSS classes |
Basic Usage
Debug Button
The debug button opens an overlay showing:- Props: Current widget props from
toolInput - Output: Tool output data (
toolOutput) - Metadata: Response metadata (
toolResponseMetadata) - State: Persistent widget state (
widgetState) - Theme: Current theme (light/dark)
- Display Mode: Current display mode (inline/pip/fullscreen)
- Safe Area: Safe area insets for mobile
- User Agent: Device capabilities
- Locale: User locale
- window.openai Keys: All available keys on the
window.openaiobject
- Call Tool: Test calling other MCP tools
- Send Follow-up Message: Send messages to ChatGPT conversation
- Open External: Test opening external URLs
- Set State: Update widget state
View Controls
View controls allow users to change the widget’s display mode:- Fullscreen Button: Expands widget to fullscreen mode
- Picture-in-Picture Button: Shows widget in a floating window
Position Customization
Control buttons can be positioned in 8 different locations:Usage with McpUseProvider
WidgetControls is automatically included when using McpUseProvider with the debugger or viewControls props:
Related Components
McpUseProvider- Unified provider that includes WidgetControlsuseWidget- Hook for accessing widget data and actions