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 Text Comment wireframe powers the small floating toolbar that appears next to selected text. Variables below are available inside any <velt-text-comment-...-wireframe> tag via three forms:
You want to…UseExample
Display a value as text<velt-data field="var" /><velt-data field="selectedWordsCount" />
Hide / show conditionallyvelt-if="{var}"velt-if="{showAdder}"
Toggle a CSS classvelt-class="'cls': {var}"velt-class="'has-words': {selectedWordsCount} > 0"
All variables are mapped — reference them by their short name. You do not need the componentConfig. prefix.
Naming conflicts — use full path. A few names collide with mappings used by Comment Dialog. Inside a Text Comment wireframe, prefer the explicit path on the right when reading these values:
Conflicting nameUse this in Text Comment
userdata.user
disableduiState.disabled
leftuiState.left
isPlanExpireduiState.isPlanExpired
shadowDomparentLocalUIState.shadowDom

Data State

Per-instance data: the active selection’s position, word / character counts, and the current user.
VariableTypeDescriptionExample
position{ top: number, left: number }Absolute position of the floating toolbar relative to the viewport.<velt-data field="position.top" />
position.topnumberTop offset in pixels.<velt-data field="position.top" />
position.leftnumberLeft offset in pixels.<velt-data field="position.left" />
selectedWordsCountnumberNumber of words in the active selection.velt-class="'has-words': {selectedWordsCount} > 0"
selectedCharactersCountnumberNumber of characters in the active selection.<velt-data field="selectedCharactersCount" />
allowedElementIdsstring[]Element ids the selection must originate from for the tool to render.<velt-data field="allowedElementIds.length" />
contextIdstring | nullContext id linking this tool to a host context.<velt-data field="contextId" />
data.userUser | nullCurrently identified end-user.<velt-data field="data.user.name" />

UI State

Per-instance UI flags driven by the tool itself.
VariableTypeDescriptionExample
showAdderbooleanFloating “add comment” adder is visible for the current selection.velt-if="{showAdder}"
commentToolEnabledbooleanComment Tool is enabled at the workspace level.velt-class="'tool-on': {commentToolEnabled}"
isUserAllowedbooleanCurrent user has permission to add text comments.velt-if="{isUserAllowed}"
enableTextCommentsbooleanText Comments feature is enabled by config.velt-if="{enableTextComments}"
rewriterEnabledbooleanAI rewriter feature is enabled.velt-if="{rewriterEnabled}"
rewriterDefaultUIEnabledbooleanDefault rewriter UI should render (instead of a custom one).velt-if="{rewriterDefaultUIEnabled}"
MIN_ALLOWED_WORDS_COUNTnumberMinimum words required before the toolbar shows.<velt-data field="MIN_ALLOWED_WORDS_COUNT" />
MIN_ALLOWED_CHARACTERS_COUNTnumberMinimum characters required before the toolbar shows.<velt-data field="MIN_ALLOWED_CHARACTERS_COUNT" />
MAX_ALLOWED_CHARACTERS_COUNTnumberMaximum characters allowed before the toolbar hides.<velt-data field="MAX_ALLOWED_CHARACTERS_COUNT" />
uiState.disabledbooleanTool is disabled by host configuration.velt-class="'disabled': {uiState.disabled}"
uiState.leftnumberHorizontal offset of the toolbar (raw value before position resolution).<velt-data field="uiState.left" />
uiState.isPlanExpiredbooleanWorkspace plan is expired.velt-class="'plan-expired': {uiState.isPlanExpired}"
darkModebooleanDark mode is active.velt-class="'dark': {darkMode}"
variantstringPer-instance variant tag set on the host element.<velt-data field="variant" />
parentLocalUIState.shadowDombooleanShadow-DOM rendering is enabled for this instance.Host config — set via element attribute.
Global config (read-only, internal). shadowDom lives on an internal globalConfigSignal not exposed to wireframes — it is reflected onto each primitive’s local state, so use {parentLocalUIState.shadowDom} to read it.

Common Props

Every Text Comment primitive accepts:
React PropHTML AttributeTypeDefaultDescription
defaultConditiondefault-conditionboolean | "true" | "false"trueWhen false, the component always renders regardless of internal state.
Signal inputs (for parent-child component composition):
  • [componentConfigSignal] — shared per-instance config signal (selection position, user, counts, allowed elements).
  • [parentLocalUIState] — per-instance UI state signal (darkMode, variant, shadowDom).

Type Reference

Types referenced by the variables above are documented in Data Models:
TypeDescription
UserIdentified end-user object.

Subcomponents

Each subcomponent below has its own wireframe tag.

text-comment-tool (root)

The root tool that renders next to a text selection.
  • Public element: <velt-text-comment-tool>
  • Wireframe tag: <velt-text-comment-tool-wireframe>
PropertyValue
Extra variablesNone — root only sees common variables.
shouldShowRenders only when an active selection exists inside an allowed element and word / character counts fall within the configured min / max.
<VeltTextCommentToolWireframe velt-class="'has-words': {selectedWordsCount} > 0">
  <span><velt-data field="selectedWordsCount" /> words selected</span>
  <VeltTextCommentToolbarWireframe />
</VeltTextCommentToolWireframe>

text-comment-toolbar

The toolbar wrapper that hosts the action buttons.
  • Public element: <velt-text-comment-toolbar>
  • Wireframe tag: <velt-text-comment-toolbar-wireframe>
  • Children (own wireframes): *-toolbar-comment-annotation, *-toolbar-copywriter, *-toolbar-generic, *-toolbar-divider.
PropertyValue
Extra variablesNone beyond common variables.

text-comment-toolbar-comment-annotation

The “Comment” action button — clicking attaches a new annotation to the selected text.
  • Public element: <velt-text-comment-toolbar-comment-annotation>
  • Wireframe tag: <velt-text-comment-toolbar-comment-annotation-wireframe>
PropertyValue
Extra variablesNone.

text-comment-toolbar-copywriter

The “AI rewrite” / copywriter action button.
  • Public element: <velt-text-comment-toolbar-copywriter>
  • Wireframe tag: <velt-text-comment-toolbar-copywriter-wireframe>
PropertyValue
Extra variablesNone.
shouldShowrewriterEnabled === true

text-comment-toolbar-generic

A generic, customisable action position for an extra button.
  • Public element: <velt-text-comment-toolbar-generic>
  • Wireframe tag: <velt-text-comment-toolbar-generic-wireframe>
PropertyValue
Extra variablesNone.

text-comment-toolbar-divider

Vertical separator between toolbar items.
  • Public element: <velt-text-comment-toolbar-divider>
  • Wireframe tag: <velt-text-comment-toolbar-divider-wireframe>
PropertyValue
Extra variablesNone.

Deeply-Nested Wireframe Tags

Text Comment root tag

TagNotesExample
<velt-text-comment-wireframe>Outer wireframe — wraps the tool.(composes the tool)

Putting it together

A typical Text Comment toolbar that appears with a word-count badge, hides the AI button when the rewriter is off, and gates the whole thing on permission:
<VeltTextCommentToolWireframe
  velt-if="{isUserAllowed} && {enableTextComments}"
  velt-class="'has-words': {selectedWordsCount} > 0">
  <span className="my-tool__count">
    <velt-data field="selectedWordsCount" /> words
  </span>
  <VeltTextCommentToolbarWireframe>
    <VeltTextCommentToolbarWireframe.CommentAnnotation>
      Comment
    </VeltTextCommentToolbarWireframe.CommentAnnotation>
    <VeltTextCommentToolbarWireframe.Copywriter velt-if="{rewriterEnabled}">
      Rewrite with AI
    </VeltTextCommentToolbarWireframe.Copywriter>
  </VeltTextCommentToolbarWireframe>
</VeltTextCommentToolWireframe>