Environment
- Node.js version:
v24.14.1
- nuxt/cli version:
3.35.1
- Package manager:
pnpm@10.33.3
- Nuxt version:
4.4.4
- Nitro version:
2.13.4
Is this bug related to Nuxt or Vue?
Nuxt
Package
v4.x
Version
v4.7.0
Reproduction
<UContentToc
:ui="{ trigger: 'font-bold' }"
/>
Expected: the trigger element renders with font-bold.
Actual: the class is ignored, the trigger renders with the default font-semibold.
Description
The ui prop on <UContentToc> does not work for the trigger slot. Passing custom classes via :ui="{ trigger: 'font-bold' }" has no visual effect, while all other slots work correctly. Seems trigger is the only slot where props.ui?.trigger is never merged in.
In ContentToc.vue, the two elements that render the trigger slot call ui.trigger() without forwarding props.ui?.trigger:
<CollapsibleTrigger data-slot="trigger" :class="ui.trigger({ class: 'lg:hidden' })">
<p data-slot="trigger" :class="ui.trigger({ class: 'hidden lg:flex' })">
Additional context
Proposed fix:
<CollapsibleTrigger
data-slot="trigger"
:class="ui.trigger({ class: [props.ui?.trigger, 'lg:hidden'] })"
>
<p
data-slot="trigger"
:class="ui.trigger({ class: [props.ui?.trigger, 'hidden lg:flex'] })"
>
Logs
Environment
v24.14.13.35.1pnpm@10.33.34.4.42.13.4Is this bug related to Nuxt or Vue?
Nuxt
Package
v4.x
Version
v4.7.0
Reproduction
Expected: the
triggerelement renders with font-bold.Actual: the class is ignored, the
triggerrenders with the default font-semibold.Description
The
uiprop on<UContentToc>does not work for thetriggerslot. Passing custom classes via:ui="{ trigger: 'font-bold' }"has no visual effect, while all other slots work correctly. Seemstriggeris the only slot whereprops.ui?.triggeris never merged in.In
ContentToc.vue, the two elements that render thetriggerslot callui.trigger()without forwardingprops.ui?.trigger:Additional context
Proposed fix:
Logs