Component edit color
Hello, I'm looking for a way to style nuxt/ui components.
For example, I'm using UNavigationMenu and I have this rendering (see screen), I'd like to change the colors of these elements.
From what I've seen, I have to do this in app.config.ts, it looks laborious but maybe I'm wrong (that's why I need your help).
Thanks in advance,
Globy

3 Replies
Hi @Globy. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Hello Globy,
You're right that styling Nuxt UI components like UNavigationMenu involves using the
app.config.ts
file. While it might seem laborious at first, Nuxt UI provides a structured way to customize component themes.
Customizing UNavigationMenu Colors
You can customize the colors of UNavigationMenu in two main ways:
1. Using the color
prop directly
The simplest approach is to use the built-in color
prop when using the component:
This changes the color scheme to use the neutral palette instead of the default primary color Navigation Menu - Color.
2. Customizing via app.config.ts
For more comprehensive styling, you can modify the app.config.ts
file to override the default theme:
This changes the global color aliases used throughout your UI components The Intuitive Vue UI Library.
3. Component-specific styling
If you need more detailed control, you can customize specific parts of the NavigationMenu by overriding its theme in app.config.ts
:
Important Note on Nuxt UI v3
If you're using Nuxt UI v3, the theming system has been updated to use the Tailwind Variants API. This means the structure of your overrides in app.config.ts
might be different from v2 Changes from v2.
For example, in v3 you would use:
While it might seem complex at first, this approach gives you fine-grained control over the styling of each component. The documentation for each component includes a "Theme" section that shows you the exact structure to use for customization.
Let me know if you need more specific guidance for your particular use case!
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@1104292217520144465> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
is someone can help me ? :/