Custom filtering, sorting and grouping
- Here is the overview on how it works:
- Enable custom actions in the comments sidebar.
- Add Velt Button Wireframe to the sidebar wireframe.
- Handle click events and lifecycle events to apply custom filtering, sorting, and grouping logic.
- Update sidebar data.
- Here are the steps to implement it:
Add Velt Buttons and handle click events
- Learn more about how to setup Velt Button Wireframe.
- Set default state using the
activeprop. - Handle
veltButtonClickevent to implement custom filtering, sorting, and grouping logic. It returns VeltButtonClickEvent.
- React / Next.js
- Other Frameworks
Handle Sidebar data lifecycle events
-
There are two lifecycle events you need to handle to implement custom filtering, sorting, and grouping logic:
commentSidebarDataInit: Triggered when comment sidebar data is first loaded. It returns CommentSidebarDataInitEventcommentSidebarDataUpdate: Triggered when comment sidebar data is updated. It returns CommentSidebarDataUpdateEvent- This event can trigger multiple times when either the comment data or unread comment count changes.
- React / Next.js
- Other Frameworks
Update sidebar data based on custom logic
- Once you have applied your custom filtering, sorting, and grouping logic, create the data an array of CommentSidebarData objects and set it in the comments sidebar.
-
Use the
optionsparameter to control if you want to group the comments or not.- React / Next.js
- Other Frameworks
Navigation
onCommentClick
- Listen for click events on comments in the sidebar to trigger actions like navigation.
- The event callback provides access to the clicked comment’s annotation object, which includes
locationandcontextdata. - Use this data to update your app’s state and navigate to the comment’s location.
| Property | Type | Description |
|---|---|---|
documentId | string | ID of the document containing the comment |
location | Object | Location details of the comment |
targetElementId | string | DOM ID of the element the comment is attached to |
context | Object | Custom context data associated with the comment |
annotation | CommentAnnotation | The full comment annotation object |
- React / Next.js
- Other Frameworks
onCommentNavigationButtonClick
- This event is triggered when the navigation button in the comment dialog in the Sidebar is clicked.
- Use this event to implement custom navigation logic.
- React / Next.js
- Other Frameworks
enableSidebarUrlNavigation
- By default, clicking a comment in the sidebar doesn’t automatically update the page URL where the comment was added.
- Use this to enable automatic URL navigation when clicking comments in the sidebar.
- If your app’s state is more complex, you might need to listen for
onCommentClickevents and implement custom navigation logic.
false
- React / Next.js
- Other Frameworks
Using Props:Using API method:
UI
currentLocationSuffix
- Adds “(this page)” suffix to the group name when the current location matches the group’s location.
false
- React / Next.js
- Other Frameworks
embedMode
- By default, the sidebar will open up from the right corner of the page.
- With embed mode, you can add the sidebar in your component and it will take up the full width and height of its container.
- When in embed mode, the sidebar will not have the close button. You need to implement your own open and close functionality on the host component.
- React / Next.js
- Other Frameworks
excludeLocationIdsFromSidebar
- Use this to filter out comments from certain locations. These comments will not be displayed in the sidebar.
- React / Next.js
- Other Frameworks
Using Props:Using API:
filterGhostCommentsInSidebar
- Fileter out and hide ghost comments from the Sidebar.
- React / Next.js
- Other Frameworks
Using Props:Using APIs:
filterPanelLayout
- Change the layout of the filter panel in the sidebar.
- Options:
menuorbottomSheetDefault: bottomSheet
- React / Next.js
- Other Frameworks
filterOptionLayout
- Change the layout of the filter options in the sidebar filter panel.
- Options:
checkbox: (default) to show the filter options in a checkbox listdropdown: to show the filter options in a searchable dropdown with checklist
- React / Next.js
- Other Frameworks
filterCount
- Disable comment count on filter options. This leads to better performance.
- React / Next.js
- Other Frameworks
dialogSelection
- When disabled, clicking a comment in the sidebar triggers a click event instead of opening the dialog inline. When combined with custom UX, this allows you to create a Figma-style sidebar experience where comments open at their location on the DOM rather than within the sidebar itself.
true
- React / Next.js
- Other Frameworks
expandOnSelection
- Controls whether comment dialogs automatically expand when selected in the sidebar.
true
- React / Next.js
- Other Frameworks
floatingMode
- This makes the sidebar open in an overlay panel over the sidebar button float over the page content.
- If you use this mode make sure you do not add Velt Sidebar Component in your app.
- React / Next.js
- Other Frameworks
focusedThreadMode
- In this mode, when you click on a comment in the sidebar, it opens the thread in an expanded view within the sidebar itself.
- Other threads and actions like filters, search etc. are hidden behind a back button.
- Enabling this mode also adds a navigation button in the comment dialog. Clicking it will navigate to the comment and trigger a callback. Learn more about it here.
- React / Next.js
- Other Frameworks
openAnnotationInFocusMode
- When enabled, opens the comment dialog in focus mode when
focusedThreadModeis enabled and either:- The ‘reply’ button inside the comment dialog is clicked, or
- A comment is selected via the
selectCommentByAnnotationId(ANNOTATION_ID)API method
- This requires
focusedThreadModeto be enabled. - Type:
VeltCommentsSidebarProps
- React / Next.js
- Other Frameworks
fullScreen
- Enable full-screen mode for the Comments Sidebar to maximize the viewing area for large volumes of feedback or detailed comment reviews.
- In full-screen mode, the sidebar expands to fill the entire viewport, providing more space to read and manage comments.
- A full-screen button appears in the sidebar header, allowing users to toggle between normal and full-screen modes.
- This feature is particularly useful when working with complex discussions, long comment threads, or when you need to focus exclusively on feedback.
false
Full-screen mode only works in default mode. It is not supported in floating mode or embed mode.
- React / Next.js
- Other Frameworks
Using Props:Using API:
pageMode
- This adds a composer in the sidebar where users can add comments without attaching them to any specific element.
Default: false
- React / Next.js
- Other Frameworks
readOnly
- Make comment dialogs in the sidebar read-only to prevent users from editing comments.
false
- React / Next.js
- Other Frameworks
position
- Change the default direction where the sidebar opens from.
- Options:
leftorright - Default:
right
- React / Next.js
- Other Frameworks
openCommentSidebar
- React / Next.js
- Other Frameworks
forceClose
Force the sidebar to close on outside click, even when opened programmatically via API. When the sidebar is opened dynamically through the API, outside clicks are normally ignored (expecting you to handle the close yourself). SettingforceClose={true} ensures outside clicks will always close the sidebar.
This does not affect embed mode sidebar.
- React / Next.js
- Other Frameworks
searchPlaceholder
- Customize the placeholder text shown in the search input of the comments sidebar.
- React / Next.js
- Other Frameworks
commentPlaceholder
Customize the placeholder text for the dialog composer (the comment input that appears in comment dialogs/threads).- React / Next.js
- Other Frameworks
replyPlaceholder
Customize the placeholder text for reply input fields in the sidebar.- React / Next.js
- Other Frameworks
pageModePlaceholder
Customize the placeholder text for the page mode composer (the comment input used for creating page-level comments).- React / Next.js
- Other Frameworks
sidebarButtonCountType
- Change the count shown on the sidebar button.
default: Shows the total count of comments in open and in progress states. (default)filter: Shows the count of filtered comments.
- React / Next.js
- Other Frameworks
Using Props:Using APIs:
commentCountType
Control whether the sidebar button shows total or unread comment count. Type:CommentCountType
total: Shows the total number of comments. (default)unread: Shows only the count of unread comments.
- React / Next.js
- Other Frameworks
Using Props:
context
Pass custom context data to page mode composer comments in the sidebar. This will add the provided context object to any comment added via the page mode composer in the sidebar, allowing you to associate additional metadata (such as job IDs, statuses, or other application-specific data) with the comment annotation.- React / Next.js
- Other Frameworks
System Filters, Sorting and Grouping
filterConfig
- Customize the available system filters:
-
location: Filter comments by location. -
document: Filter comments by document. -
people: Filter comments by author of comment annotation. -
involved: Filter comments by users who are involved in the comment annotation (author, mentioned, assigned). -
tagged: Filter comments by users who were tagged/mentioned in the comment. Only available in the latest SDK version. -
assigned: Filter comments by users who were assigned to the comment. Only available in the latest SDK version. -
priority: Filter comments by priority. -
category: Filter comments by category. -
status: Filter comments by status. - You can rename, disable, configure grouping, and multi-select behavior of the filters as needed.
- React / Next.js
- Other Frameworks
groupConfig
- Enable/disable the option to group comments in the sidebar with the
group configattribute. - If you use floating mode, you can pass this config in Sidebar Button Component.
- React / Next.js
- Other Frameworks
sortOrder
Set default sort order for comments in the sidebar. Options:asc or desc
- React / Next.js
- Other Frameworks
sortBy
Set default sort field for comments in the sidebar. Options:createdAt or lastUpdated
- React / Next.js
- Other Frameworks
setCommentSidebarFilters
- Programmatically set the system filters on the sidebar:
- React / Next.js
- Other Frameworks
systemFiltersOperator
- Specify whether the system filters (e.g., “me”, “this page”) should be combined with an
andororoperator. - Default:
and
- React / Next.js
- Other Frameworks
Using Props:Using API:
defaultMinimalFilter
Set the default minimal filter setting for the sidebar. This controls how resolved comments are handled in relation to other filters. Type:'all' | 'read' | 'unread' | 'resolved' | 'open' | 'reset' | null
| Value | Description |
|---|---|
'all' | (Default) Respects other filters; excludes resolved comments unless explicitly included |
'read' | Shows only comments that have been read by the current user |
'unread' | Shows only comments that have not been read by the current user |
'resolved' | Shows only resolved comments |
'open' | Shows only open (unresolved) comments |
'reset' | Ignores all filters; shows all comments including resolved |
null | Respects other filters; includes resolved comments (no minimal filter exclusion) |
- React / Next.js
- Other Frameworks

