Look and Feel

Part Overrides with Components ​

A part override replaces the markup of one part of the thread, such as the name of a comment's author, its badges or the empty state, and keeps everything else. In Vue, the override is a component. It's rendered through a Teleport into the place the renderer leaves for it, so it stays inside your app's tree, with your provides, stores and router, and it follows its comment when a vote or a reply redraws the thread.

A Verified Badge ​

Suppose some commenters carry a verified badge, which your site adds on the server with the plugin's Comments::EVENT_DEFINE_BADGES event. This component draws it with a tick, and keeps Comments' own badge classes for every other badge so its stylesheet still styles them:

vue
<!-- VerifiedBadge.vue -->
<script setup lang="ts">
type Badge = { type: string; label: string };

// An override gets only the props it declares.
defineProps<{ badge: Badge }>();
</script>

<template>
    <span v-if="badge.type !== 'verified'" :class="`comments__badge comments__badge--${badge.type.replace(/[^\w-]/g, '')}`">{{ badge.label }}</span>
    <span v-else class="badge badge-success">✓ {{ badge.label }}</span>
</template>
vue
<script setup lang="ts">
import { CommentsThread, type CommentsPartOverrides } from '@verbb/comments-vue';
import VerifiedBadge from './VerifiedBadge.vue';

defineProps<{ uri: string }>();

const parts: CommentsPartOverrides = { badge: VerifiedBadge };
</script>

<template>
    <CommentsThread :key="uri" :owner-uri="uri" :parts="parts" />
</template>

The Vue starter draws its badges with this component.

What a Component Is Given ​

A component gets the part's context as props, typed as CommentsPartProps. It gets only the props it declares, in the component itself or through its extends or mixins, so the rest never land on its element as attributes, and a component that declares none gets none.

PropWhat it is
The part's dataSuch as comment, viewer, permissions and conversation, or badge for a badge. The table lists each part's.
labelsThe thread's translated wording.
actionsFor a comment's parts, vote(), reply(), edit(), delete(), report(), copyLink(), moderate(), toggleReplies() and loadReplies(), bound to the comment.
controlAttributesA function giving the attributes of one of the ten controls with your themeConfig applied, which you can bind with v-bind.
renderDefaultIntoA function that draws Comments' own markup for the part into an element of your component's.

Wrapping Comments' Own Markup ​

renderDefaultInto(element) draws Comments' own markup for the part into an element of your component's, for a component that adds something around it. Call it after each render, such as from onMounted() and onUpdated().

vue
<script setup>
import { onMounted, onUpdated, useTemplateRef } from 'vue';

const props = defineProps(['comment', 'renderDefaultInto']);
const inner = useTemplateRef('inner');
const draw = () => inner.value && props.renderDefaultInto(inner.value);

onMounted(draw);
onUpdated(draw);
</script>

<template>
    <div ref="inner" class="content-card" />
</template>

For the whole comment part, Comments keeps its list item, the comment's form and its replies around your component, so the component draws only what goes inside.

Defining Components ​

Import override components, as above, rather than defining them in a render function, which would make a new component each time. If a component throws, the error reaches your app's errorHandler, and Comments' own markup is drawn in its place.

Overrides Without Vue ​

For static markup that needs no Vue at all, templatePart() passes a function to the renderer instead, which is cheaper than a Teleport. It's given the same context as a function override, with lit-html's html tag. A registered custom element's name works too, as Part Overrides with Custom Elements describes.

js
import { templatePart } from '@verbb/comments-vue';

const parts = {
    badge: templatePart(({ badge, html, defaultRender }) => badge.type === 'verified' ? html`<span class="badge">✓ ${badge.label}</span>` : defaultRender()),
};

The Parts ​

PartGroupWhat it drawsIts own context
headerThreadThe heading with the count, the sort options, Follow and a moderator’s summary of held and reported commentsviewer, conversation and state
emptyThreadWhat a thread with no comments saysviewer, conversation and state
showButtonThreadThe Show comments button for the button load modeviewer, conversation and state
loadingThreadThe loading line while the thread’s data is on its wayviewer, conversation and state
noticeThreadWhy nobody can post, such as a closed thread’s noticenotice, the text, with viewer, conversation and state
commentCommentThe whole commentcomment, permissions, viewer, conversation, actions, and form() and replies(), which the override must draw
avatarCommentThe author’s avatarcomment, permissions, viewer, conversation and actions
authorNameCommentThe author’s namecomment, permissions, viewer, conversation and actions
badgeCommentOne of the author’s badges, once for eachbadge (its type and label), with the comment’s context
metaCommentThe date and permalink, inline custom fields and the edited notecomment, permissions, viewer, conversation and actions
contentCommentThe comment’s textcomment, permissions, viewer, conversation and actions
fieldsCommentThe custom fields shown under the text, as a labelled listfields, the comment’s entries shown under its text, with the comment’s context
actionsCommentVotes, Reply and the ··· menucomment, permissions, viewer, conversation and actions
reviewCommentA moderator’s review box on a held or reported commentmoderation, the comment’s moderation details, with the comment’s context
placeholderCommentWhat stands in for a comment that’s no longer shown but still has repliescomment, permissions, viewer, conversation and actions
joinEditorThe sign-in card a guest sees in place of the comment boxviewer, conversation and state
postingAsEditor“Posting as” and the member’s badges, above a member’s comment boxviewer
formFieldsEditorThe custom fields the form asks for, once for those above the text and once for those below itfields, the descriptions of the fields in this group, and position, above or below

The comment form itself, the comment box, the rich text editor and the report form can't be overridden, because they carry spam protection, the editor's loading and keyboard focus. Their look is reached through styling, and custom fields on the form and the comment have components of their own, by handle, as Field Overrides with Components describes.

Removing Something ​

An override can return nothing, but to remove a feature, turn it off in the plugin's settings first. A setting also stops the server offering the feature, so hiding the vote buttons with an empty actions override would still let anyone vote through the data API, whereas setting Interaction Mode to None removes voting altogether.

Last updated: Nov 18, 2026, 12:27 PM