Skip to content

[ContentToc] ui.trigger prop is ignored / not applied to rendered elements #6428

@whoisjorge

Description

@whoisjorge

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageAwaiting initial review and prioritizationv4#4488

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions