Nuxt UI: Build a Dashboard Template
Plans from $25/month

This lesson is for members. Join us?

Subscribe now and get immediate access to this course, 30 more and all future Vue.js courses!

Dynamic Variants for Robust Theme Switching in Nuxt UI

In this lesson, learn how to dynamically set the ui in app config to support robust theme switching. The strategy is quite simple:

  1. Define the tailwind classes for slots, variants, and component variants for a theme in a central location
  2. Dynamically import that configuration with @import and call Nuxt’s built-in updateAppConfig function to set the new ui config.
  3. That’s it 🎉

Links