OpenAI Loading Animation - Using Lottiefiles
In this Bubble tutorial we demonstrate how to improve your Bubble app's UX (user experience) by showing a loading animation while you wait for a response from the OpenAI API (ChatGPT). This tutorial uses a Lottie animation from Lottiefiles.
Unlock the power of loading animations: Learn how to enhance your Bubble app's UI with Lottie animations during API calls!
Elevate your user experience: Discover how to implement a sleek progress bar while your Bubble app fetches data from OpenAI.
Master the art of seamless API integration: Transform your Bubble app's loading process with custom animations and improved user feedback.
Adding a Loading Animation to Your Bubble App
In this Bubble tutorial video, I'm going to demonstrate how you can add in a loading animation while your Bubble app makes the API call to the OpenAI API. This is a great bit of UI and UX improvement that you can make to your app because sometimes users just get a bit confused when they click a button and it appears like nothing happens. Yes, Bubble puts a floating bar going across the top of the screen if you're doing a client-side workflow, but you can improve upon that so that your users know that they're getting something good and that they need to wait for it. This is all important when you're using OpenAI with Bubble.
Using Lottie Animations for Loading Indicators
I'm going to demonstrate in this tutorial how to do that with Lottie animations. Lottie files have become a popular format for animations on the web because they're lightweight. They're basically JSON files and they scale quite nicely too. So they've got a number of advantages over GIFs or other image animation files.
Adding the Lottie Plugin to Your Bubble App
To add in a Lottie animation, I need to add in a plugin. I'm just going to pick one of these. This one's got a lot of users, let's try that one and add in Lottie. Let's just make this 300 by 300. Obviously, you can adapt to the right size. For the Lottie file, if you want complete control over where you're hosting it, you can download the Lottie file and upload it to your Bubble storage. But in this example, I'm just going to pick one of these and link directly to it into one of my workspaces in Lottie.
Configuring the Lottie Animation
I think I need to click this one here of JSON. So then I paste that in there as the dynamic link and I'm going to preview my app to see if it loads in the Lottie animation correctly. Brilliant, yes it does.
Implementing the Loading Animation in Your Workflow
So how do I get it to show during my API call and hide the rest of the time? First of all, I've made sure that wherever I'm displaying my results, I have this unticked: "The element is visible on page load" and I tick "Collapse when hidden". Then on my Lottie element, now that I've added that in, I'm going to also say it is not visible on page load and it's collapsed when hidden.
Adding Workflow Steps for the Loading Animation
I need to add just a couple of steps or maybe three steps to my submit button. The first thing I'm going to do when the button's clicked is show my Lottie animation. I'm going to show that first. This is where the app makes a call to the OpenAI API, and so this is actually where the waiting occurs. Then, in this case, I'm using a custom state. I'm saving it as a custom state in order to display the results on my page. So I'm going to add in here "hide Lottie" because I know that it's completed the wait from OpenAI here, and then I'm going to show, in this case, I'm using a multi-line input. This just happens to be the element I'm using to display the reply from OpenAI.
Testing the Loading Animation
Let's preview and I'll go Twitter again and I'll say "What are the limitations of Bubble?" Okay, so I see my animation. I'm also getting the Bubble loading bar across the top, and then the animation gives way to the results.
Conclusion
So there you have it. That is how you can use a loading animation to improve the UI in your Bubble app. If you're learning Bubble, you need to check out our website Planet No Code where we've got hundreds of Bubble tutorial videos, some of which you cannot find on YouTube. We're just hoping to create the best resource for learning Bubble out there.
Ready to Transform Your App Idea into Reality?
Access 3 courses, 400+ tutorials, and a vibrant community to support every step of your app-building journey.
Start building with total confidence
No more delays. With 30+ hours of expert content, you’ll have the insights needed to build effectively.
Find every solution in one place
No more searching across platforms for tutorials. Our bundle has everything you need, with 400+ videos covering every feature and technique.
Dive deep into every detail
Get beyond the basics with comprehensive, in-depth courses & no code tutorials that empower you to create a feature-rich, professional app.
Valued at $80
Valued at $85
Valued at $30
Valued at $110
Valued at $45
14-Day Money-Back Guarantee
We’re confident this bundle will transform your app development journey. But if you’re not satisfied within 14 days, we’ll refund your full investment—no questions asked.
Can't find what you're looking for?
Search our 300+ Bubble tutorial videos. Start learning no code today!
Frequently Asked Questions
Find answers to common questions about our courses, tutorials & content.
Not at all. Our courses are designed for beginners and guide you step-by-step in using Bubble to build powerful web apps—no coding required.
Forever. You’ll get lifetime access, so you can learn at your own pace and revisit materials anytime.
Our supportive community is here to help. Ask questions, get feedback, and learn from fellow no-coders who’ve been where you are now.
Absolutely. If you’re not satisfied within 14 days, just reach out, and we’ll issue a full refund. We stand by the value of our bundle.
Yes, this is a special limited-time offer. The regular price is $350, so take advantage of the discount while it lasts!