Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.velt.dev/llms.txt

Use this file to discover all available pages before exploring further.

New to wireframes? Start with UI Customization Concepts and the Template Variables overview.

Overview

The Comment Sidebar Button is the standalone toolbar button that opens the Comment Sidebar, with built-in unread-count and total-count indicators. Variables below are available inside any <velt-sidebar-button-...-wireframe> tag via three forms:
You want to…UseExample
Display a value as text<velt-data field="var" /><velt-data field="componentConfig.data.unreadCount" />
Hide / show conditionallyvelt-if="{var}"velt-if="{componentConfig.data.unreadCount} > 0"
Toggle a CSS classvelt-class="'cls': {var}"velt-class="'sidebar-open': {globalConfig.featureState.sidebarVisible}"
This feature uses the flat-config access pattern — variables span three namespaces: globalConfig.featureState.* (cross-document), componentConfig.<data|uiState>.* (per-instance), and parentLocalUIState.* (per-render). Always use the explicit path form.

Component Config

Global Feature State

VariableTypeDescriptionExample
globalConfig.featureState.sidebarVisiblebooleanLinked sidebar is currently open. Drives the active state on the button.velt-class="'sidebar-open': {globalConfig.featureState.sidebarVisible}"

Per-instance Data

VariableTypeDescriptionExample
componentConfig.data.annotationsCommentAnnotation[] | undefinedAll annotations in scope for this button. Length drives the total-count badge.<velt-data field="componentConfig.data.annotations.length" />
componentConfig.data.unreadCountnumber | nullUnread-count badge value.<velt-data field="componentConfig.data.unreadCount" />

Per-instance UI State

VariableTypeDescriptionExample
componentConfig.uiState.showDefaultBtnbooleanDefault built-in button should render. Set to false when a wireframe overrides the button entirely.velt-if="{componentConfig.uiState.showDefaultBtn}"
componentConfig.uiState.floatingModebooleanButton is rendering in floating mode.velt-class="'floating': {componentConfig.uiState.floatingMode}"
componentConfig.uiState.floatingModeSidebarVisiblebooleanFloating-mode sidebar is currently open.velt-class="'floating-open': {componentConfig.uiState.floatingModeSidebarVisible}"
componentConfig.uiState.darkModebooleanDark mode is active for this instance.velt-class="'dark': {componentConfig.uiState.darkMode}"
componentConfig.uiState.commentCountType'total' | 'unread'Which count drives the badge.velt-class="'count-{componentConfig.uiState.commentCountType}': true"

Per-instance Local UI State

VariableTypeDescriptionExample
parentLocalUIState.darkModebooleanLocal dark-mode flag (host attribute).velt-class="'dark': {parentLocalUIState.darkMode}"
parentLocalUIState.variantstringPer-instance variant tag set on the host element.<velt-data field="parentLocalUIState.variant" />
parentLocalUIState.shadowDombooleanShadow-DOM rendering is enabled.Host config — set via element attribute.

Type Reference

Types referenced by the variables above:
TypeDescription
CommentAnnotationThe annotation thread (id, status, comments, from, etc.).
UserIdentified end-user object (via annotation.from).

Subcomponents

Each subcomponent below has its own wireframe tag. The trigger button customers place in their toolbar.
  • Public element: <velt-sidebar-button>
  • Wireframe tag: <velt-sidebar-button-wireframe>
  • Children: sidebar-button-icon, sidebar-button-comments-count, sidebar-button-unread-icon.
PropertyValue
Extra variablesNone — root only sees common variables.
Host classvelt-sidebar-button (always). velt-sidebar-button--visible / velt-sidebar-tool-open when globalConfig.featureState.sidebarVisible is true. dark when darkMode is true. velt-tool--action-btn (always on the inner button). velt-sidebar-button--icon-wrapper (around the icon).
<VeltSidebarButtonWireframe>
  <button
    className="my-sidebar-trigger"
    velt-class="'active': {globalConfig.featureState.sidebarVisible}">
    <VeltSidebarButtonWireframe.Icon />
    <VeltSidebarButtonWireframe.CommentsCount />
    <VeltSidebarButtonWireframe.UnreadIcon />
  </button>
</VeltSidebarButtonWireframe>

The default chat icon.
  • Public element: <velt-sidebar-button-icon>
  • Wireframe tag: <velt-sidebar-button-icon-wireframe>
PropertyValue
Extra variablesNone.
Host classvelt-tool--action-btn-icon (on the inner SVG).
<VeltSidebarButtonWireframe.Icon>
  <i className="my-icon icon-chat" />
</VeltSidebarButtonWireframe.Icon>

The badge showing total or unread comment count.
  • Public element: <velt-sidebar-button-comments-count>
  • Wireframe tag: <velt-sidebar-button-comments-count-wireframe>
PropertyValue
Extra variablesNone.
Host classaction-btn-label velt-sidebar-button--comments-count (always on the host span).
shouldShowDefault branches on componentConfig.uiState.commentCountType'total' shows componentConfig.data.annotations.length; 'unread' shows componentConfig.data.unreadCount.
<VeltSidebarButtonWireframe.CommentsCount>
  <span className="my-count">
    <velt-data field="componentConfig.data.annotations.length" />
  </span>
</VeltSidebarButtonWireframe.CommentsCount>

The “unread dot” overlay shown when there are unread comments.
  • Public element: <velt-sidebar-button-unread-icon>
  • Wireframe tag: <velt-sidebar-button-unread-icon-wireframe>
PropertyValue
Extra variablesNone.
Host classvelt-sidebar-button--unread-icon (on the inner SVG).
shouldShowcomponentConfig.data.unreadCount > 0
<VeltSidebarButtonWireframe.UnreadIcon>
  <span
    className="my-unread-dot"
    velt-if="{componentConfig.data.unreadCount} > 0">
    <velt-data field="componentConfig.data.unreadCount" />
  </span>
</VeltSidebarButtonWireframe.UnreadIcon>

Putting it together

A typical Comment Sidebar Button that lights up while the sidebar is open, swaps between total / unread count modes, and shows an unread dot when relevant:
<VeltSidebarButtonWireframe>
  <button
    className="my-trigger"
    velt-class="'is-active': {globalConfig.featureState.sidebarVisible}">
    <VeltSidebarButtonWireframe.Icon />
    <VeltSidebarButtonWireframe.CommentsCount>
      <span velt-if="{componentConfig.uiState.commentCountType} === 'total'">
        <velt-data field="componentConfig.data.annotations.length" />
      </span>
      <span velt-if="{componentConfig.uiState.commentCountType} === 'unread'">
        <velt-data field="componentConfig.data.unreadCount" />
      </span>
    </VeltSidebarButtonWireframe.CommentsCount>
    <VeltSidebarButtonWireframe.UnreadIcon
      velt-if="{componentConfig.data.unreadCount} > 0" />
  </button>
</VeltSidebarButtonWireframe>