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

This lesson is for members. Join us?

Subscribe now to get instant access to this course, plus a full library of Vue.js courses tailored to the plan you choose.

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