Insights and Inspiration – The Hostnicker Blog

Using Webflow to Build Custom Loading Spinners

August 18, 2024

Step 1: Set Up Your Webflow Project
Start by logging in to your Webflow account. You can either create a new project or open an existing one. If you opt for a new project, choose a blank template for a fresh start. This approach gives you a clean canvas for designing your loading spinner.

Step 2: Create a New Loader Element
Open the Designer for your project. In the left sidebar, locate and click on the Add (+) button. Under the Elements section, drag a Div Block onto your canvas. This element will be the container for your loading spinner. With the Div Block selected, go to the Style panel and give it a class name, such as loader.

Step 3: Style the Loader Container
Set the position of the loader to fixed so it covers the entire viewport. In the Style panel, select Position and choose Fixed. Enter 0 for the top, left, right, and bottom fields to make sure it occupies the full screen. Assign a background color to the loader. For a semi-transparent effect, use an RGBA value like rgba(255, 255, 255, 0.8).

Step 4: Add the Spinner Element
Inside the loader div, drag another Div Block to create the spinner. Assign this inner Div Block a class name, such as spinner. In the Style panel, adjust the width and height to be equal for a perfect circle; a common size is 80px by 80px. Set the border radius to 50% to shape the div into a circle. Add a border for the spinner effect by setting a solid color and a width (like 8px), leaving one side transparent for spinning.

Step 5: Create the Spinner Animation
With the spinner div selected, open the interactions panel (lightning bolt icon). Click on Element Trigger and choose Mouse Load. Set an Animation on Load. Create a new animation and name it Rotate Spinner. Add a new action for rotation, set the angle to 360 degrees, configure the duration to around 1 second, and ensure it loops by selecting Infinite.

Step 6: Set Up Loader Visibility
To make the spinner disappear once content loads, revisit the interactions panel. Add a page load trigger that hides the loader after content is fully loaded. Create a new animation for the page load, including an action that sets the loader display to none at the animation's end.

Step 7: Preview and Test Your Spinner
Preview your spinner by clicking the Preview button in the top right corner of the Designer. Ensure the spinner appears during page loading and disappears once content is ready.

Step 8: Fine-Tune Your Design
Get creative by experimenting with colors, border styles, or additional animations. Adjust the rotation speed, explore effects like scaling, or add a shadow for depth.

Step 9: Publish Your Site
Once satisfied, publish your website to make the loading spinner live. Click the Publish button in the top right corner to deploy your changes.

Conclusion
Congratulations on creating a custom loading spinner in Webflow. This spinner enhances the user experience by visually indicating content processing while allowing you to express your creativity. Experiment with different designs, animations, or colors to perfect a spinner that complements your website's mission.