Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

620
Views
How to make background dark, when v-dialog opens in vue js

Here is my sample code I have added a v-dialog ftom vuetify. I want the background to be dark/black or blur when the v-dialog opens

<v-dialog v-model="logoutdialog" width="500" >
     <v-card>
     <v-card-title>
     <span>Logout</span>
     <v-spacer></v-spacer>
     <v-menu bottom left>
     <template v-slot:activator="{ on, attrs }">
     <v-btn
     icon
     v-bind="attrs"
     v-on="on"
     @click="logoutdialog= false">
     <v-icon>mdi-close</v-icon>
     </v-btn>
     </template>
     </v-menu>
     </v-card-title>
     <v-card-actions>
     <v-btn
     color="primary" text @click="logoutdialog = false">
     Close
     </v-btn>
     </v-card-actions>
     </v-card>
         [![expected output][1]][1]
</v-dialog>

The below attached is the sample code [1]: https://i.stack.imgur.com/oXD3f.jpg

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Here's something that works for me in vue2

<style>
/* hide the "scrim", it's pointless */
.v-overlay--active .v-overlay__scrim {
    display: none;
}
/* style the overlay container as required */
.v-overlay--active {
    backdrop-filter: blur(2px);
    background: rgb(0 0 0 / 0.8);
}
/* if you have an auto dark theme
   for prefers-color-scheme: dark
   I find the 0.8 too dark
*/
@media (prefers-color-scheme: dark) {
    .v-overlay--active {
        background: rgb(0 0 0 / 0.4);
    }
}
</style>
about 4 years ago · Juan Pablo Isaza Report

0

You can do this by defining overlay-color and overlay-opacity props for v-dialog component.

API documentation: https://vuetifyjs.com/en/api/v-dialog/#props-overlay-color

Example: https://codesandbox.io/s/vuetify-playground-forked-t9zhps?file=/src/layout.vue:0-1695

<v-dialog
  v-model="logoutdialog"
  width="500"
  overlay-color="black"
  overlay-opacity="1"
>
// rest of the code
</v-dialog>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!