Vuetify - Add loading layer overlay on click event

Stefan Bogdanescu

Founder & Senior Architect · 2026-06-29

Laravel Company

Vuetify Loading Overlays: Implementing Progress Indicators for a Better UX

Welcome to the world of Laravel and Vuetify! As you start building dynamic applications, one of the most crucial aspects of user experience (UX) is providing clear feedback during asynchronous operations. When a user clicks a button to save data, they need to know that the system is working and not just waiting in silence. You are absolutely right to look for a native Vuetify solution rather than relying on external libraries.

While finding a single "Load Overlay" component might be elusive in the core documentation, we can achieve this effect beautifully by combining existing Vuetify components, primarily v-overlay or by managing modal states effectively. This post will walk you through the best native methods to implement loading overlays for your actions.

Understanding Loading States in Vue and Vuetify

In a modern Single Page Application (SPA) built with Vue and Vuetify, the key is state management. When a user initiates an action (like saving data), you must immediately switch the UI into a "loading" state. This prevents duplicate submissions and informs the user that the system is processing their request.

For actions that require user attention or confirmation during processing (like a form submission), using a modal dialog (v-dialog) combined with a loading spinner is often the most intuitive approach. However, for simple background operations where you just need an overlay, v-overlay is the perfect native tool.

Method 1: Implementing a Custom Overlay with v-overlay

The v-overlay component in Vuetify is designed specifically to place content on top of other elements, making it ideal for creating loading screens or notification overlays.

To achieve your goal—an overlay that appears on click and shows a progress icon—you need to manage the visibility state of this overlay based on your backend request status (e.g., an API call is pending).

Here is a conceptual example demonstrating how you might use v-overlay to show a loading spinner over the content when an action is triggered:

vue
<template>
  <div>
    <!-- The main content area -->
    <div v-if="isLoading" class="loading-overlay">
      <v-progress-circular indeterminate color="primary"></v-progress-circular>
      <p>Processing request...</p>
    </div>

    <!-- The actual button that triggers the action -->
    <v-btn @click="submitData" :disabled="isLoading">
      {{ isLoading ? 'Saving...' : 'Save Changes' }}
    </v-btn>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isLoading: false,
    };
  },
  methods: {
    async submitData() {
      this.isLoading = true; // Set loading state to true immediately
      try {
        // Simulate an API call (where you would integrate with Laravel)
        await new Promise(resolve => setTimeout(resolve, 2000));
        console.log('Data saved successfully!');
      } catch (error) {
        console.error('Error during submission:', error);
      } finally {
        this.isLoading = false; // Turn off loading state when done
      }
    }
  }
};
</script>

<style scoped>
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7); /* Semi-transparent white background */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000; /* Ensure it sits above other content */
}
</style>

Key Takeaways from the Example:

  1. State Control: The core of this is the isLoading boolean variable. It controls what the user sees and what actions are permitted.
  2. Overlay Styling: We use standard CSS (position: absolute;, semi-transparent background) to create the visual overlay effect.
  3. Feedback Loop: Crucially, we set isLoading = true before the asynchronous operation begins and reset it in the finally block once the operation completes (whether successful or failed).

Integrating with Laravel Architecture

When you are working on a full-stack application using Laravel for your API backend, this frontend logic interacts directly with your controllers. For instance, when submitData runs, it will typically use axios (or fetch) to send a request to your Laravel endpoints. Following the principles of clean separation, ensure that your Vue component remains focused on presentation and state management, while the data persistence and business logic reside securely within your Laravel application. This separation is fundamental to building scalable applications, much like how you structure Eloquent models when working with Laravel.

Conclusion

Implementing loading overlays in Vuetify is fundamentally about managing the state of your components efficiently. By leveraging native components like v-overlay and carefully controlling boolean flags, you can provide excellent user feedback without needing external dependencies. Focus on setting clear states—loading, success, or error—and ensure that every action flows smoothly from the frontend presentation to your robust Laravel backend. Happy coding!