UI Responses
Learn how to make your AI show beautiful custom interfaces
What’s This About?
Instead of just showing text responses, your AI can display beautiful custom UIs like:
- Forms to collect information
- Charts and graphs
- Product cards
- Settings toggles
- And much more!
Quick Example: Weather Display
Let’s create a simple weather display UI. We’ll build an AI that shows weather data in a nice card with a graph.
Create the Weather Action
- Go to your dashboard
- Create a new action called
getTheWeather
- Set it as a
GET
request - Use this URL:
Add the Widget to Your App
Add this code to your React app:
Create the Weather Display
Create a new file called WeatherDisplay.tsx
:
How It Works
- When someone asks about the weather, your AI calls the
getTheWeather
action - The action gets data from the weather API
- Our widget finds the matching component (
WeatherDisplay
) - The component shows the weather data in a nice UI
That’s it! Now when users ask about the weather, they’ll see a beautiful card with current conditions and a temperature graph.
Remember to:
- Match your component’s
key
with your action name - Make sure your component can handle the data structure from your action
- Use shadcn/ui components for consistent styling
What You Can Build
You can create UIs for many purposes:
- Product displays
- Booking forms
- Data visualizations
- Settings panels
- And much more!
Just create an action that returns the data you need, and a component to display it how you want.
Need help? check out more examples in our GitHub repo.
Was this page helpful?