N
Nuxt5w ago
kitten

Nuxt UI v3

how can i delete a class from a components theme. for example removing the ring from the card component.
2 Replies
kapa.ai
kapa.ai5w ago
Hi @kitten. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To remove a class like the ring from the Card component in Nuxt UI v3, you can override the component's configuration in your app.config.ts file or use the ui prop directly on the component. Here's how you can do it: 1. Using app.config.ts:
export default defineAppConfig({
ui: {
card: {
ring: ''
}
}
})
export default defineAppConfig({
ui: {
card: {
ring: ''
}
}
})
2. Using the ui prop on the component:
<template>
<UCard :ui="{ ring: '' }">
<!-- Card content -->
</UCard>
</template>
<template>
<UCard :ui="{ ring: '' }">
<!-- Card content -->
</UCard>
</template>
Both methods will remove the ring class from the Card component. The ui prop method allows you to customize the component on a per-instance basis, while the app.config.ts method applies the change globally to all Card components in your application. Nuxt UI Theming (https://ui.nuxt.com/getting-started/theming#components) documentation provides more details on customizing component themes. Remember that Nuxt UI uses tailwind-merge (https://github.com/dcastil/tailwind-merge) to smartly merge classes, so you don't have to rewrite everything when customizing components. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai5w ago
<@1265695120725119036> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?