#Having trouble migrating to Nuxt UI v3
3 messages · Page 1 of 1 (latest)
Migrating your custom Tab styles from Nuxt UI v2 to v3 requires updating your app.config.ts to match the new theming system, which now uses the Tailwind Variants API. The structure for overriding component styles has changed significantly—slot and variant overrides are now nested under slots and variants keys, and the old flat style overrides are no longer supported.
Your v2 config:
export default defineAppConfig({
ui: {
tabs: {
list: {
width: "max-w-sm",
background: "bg-gray-200 dark:bg-gray-700",
marker: {
background: "dark:bg-gray-800"
}
}
}
}
})
How to migrate to v3:
-
Move overrides to the
slotskey:
In v3, you override the classes for each slot (e.g.,list,indicator, etc.) inside aslotsobject. -
Use Tailwind classes directly:
You can now assign your custom classes directly to the relevant slots.
Example migrated config for v3:
export default defineAppConfig({
ui: {
tabs: {
slots: {
list: 'max-w-sm bg-neutral-200 dark:bg-neutral-700',
indicator: 'dark:bg-neutral-800',
// Add other slot overrides as needed
}
}
}
})
- Note: The color
grayhas been renamed toneutralin v3, so update your Tailwind classes accordingly (e.g.,bg-gray-200→bg-neutral-200) see migration guide. - The
markerslot from v2 is now calledindicatorin v3 see theme docs.
Summary of changes:
- All style overrides must be placed under
slots. - Use the new color aliases (
neutralinstead ofgray). - Refer to the Tabs theme section for all available slots and their names.
If you need to override more slots (like trigger, label, etc.), add them under the slots key in the same way.
For more details, see the official migration guide and the Tabs theme documentation.