Set global size for all component using app.config.ts
How to set global size for all component using app.config.ts> I tried the followinf it does nto work:
2 Replies
Hi @mubaidr. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
To set a global size for all components using
app.config.ts
in Nuxt UI, you need to modify your configuration slightly. The approach you've tried is close, but not quite correct. Here's how you can set a global default size for components:
This configuration sets the default size for buttons to "lg". However, it's important to note that you need to do this for each component type individually, as there isn't a single global setting for all components.
The reason for this is that different components may have different size options or implementations. As stated in the Nuxt UI Theming documentation:
"Some component props like size
, color
, variant
, etc. have a default value that you can override in your app.config.ts
."
If you want to set a default size for multiple components, you would need to repeat this structure for each component type. For example:
Remember that this sets the default size, which can still be overridden on individual component instances if needed.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@255041865672294410> Kapa.ai is still learning and improving, please let me know how I did by reacting below.