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 View Analytics feature surfaces the “who’s viewed this document today” indicator. Variables below are available inside any <velt-view-analytics-...-wireframe> tag via three forms:
You want to…UseExample
Display a value as text<velt-data field="var" /><velt-data field="componentConfig.todayViewsCount" />
Hide / show conditionallyvelt-if="{var}"velt-if="{componentConfig.treadsVisible}"
Toggle a CSS classvelt-class="'cls': {var}"velt-class="'dialog-open': {componentConfig.treadsVisible}"
This feature uses the flat-config access pattern — variables are referenced via the explicit componentConfig.<path> form. The trigger and the dialog / bottom-sheet variants expose different variable sets (documented separately below).

Component Config — View Analytics

State on the <velt-view-analytics> trigger.
VariableTypeDescriptionExample
componentConfig.todaystringToday’s date string (e.g. '2026-05-11').<velt-data field="componentConfig.today" />
componentConfig.todayViewsanyToday’s view records.<velt-data field="componentConfig.todayViewsCount" />
componentConfig.todayViewsCountnumberNumber of users who viewed today.<velt-data field="componentConfig.todayViewsCount" />
componentConfig.totalUniqueViewsRecord<string, any>All unique viewers keyed by userSnippylyId.<velt-data field="componentConfig.totalUniqueViewsCount" />
componentConfig.totalUniqueViewsCountnumberTotal unique viewer count.<velt-data field="componentConfig.totalUniqueViewsCount" />
componentConfig.treadsVisiblebooleanDialog is currently open.velt-class="'dialog-open': {componentConfig.treadsVisible}"
componentConfig.customButtonAddedbooleanA custom trigger has replaced the default.velt-if="!{componentConfig.customButtonAdded}"
componentConfig.isPhonebooleanMobile layout flag.velt-class="'is-phone': {componentConfig.isPhone}"

Component Config — View Analytics Dialog / Bottom Sheet

State shared between <velt-view-analytics-dialog> and <velt-view-analytics-bottom-sheet> (same data, different presentation).
VariableTypeDescriptionExample
componentConfig.viewsViewsAll views by date.<velt-data field="componentConfig.views.today.count" />
componentConfig.usersMapRecord<string, User>Viewers keyed by userSnippylyId.<velt-data field="componentConfig.usersMap[userSnippylyId].name" />
componentConfig.userViews{ user: User; timestamp: number }[]Sorted user-view list.<velt-data field="componentConfig.userViews.length" />
componentConfig.bottomSheetModebooleanBottom-sheet variant is active (mobile).velt-class="'bottom-sheet': {componentConfig.bottomSheetMode}"

Type Reference

Types referenced by the variables above:
TypeDescription
UserIdentified end-user object (used by usersMap and userViews.<i>.user).
ViewsAll-views-by-date shape used by componentConfig.views.

Subcomponents

Each subcomponent below has its own wireframe tag.

view-analytics

The trigger button that shows the “N people viewed today” badge.
  • Public element: <velt-view-analytics>
  • Wireframe tag: <velt-view-analytics-wireframe>
PropertyValue
Extra variablesSee Component Config — View Analytics.
<VeltViewAnalyticsWireframe>
  <button
    className="my-trigger"
    velt-class="'is-open': {componentConfig.treadsVisible}">
    <span>Viewed today</span>
    <span className="my-trigger__count">
      <velt-data field="componentConfig.todayViewsCount" />
    </span>
  </button>
</VeltViewAnalyticsWireframe>

view-analytics-dialog

The desktop popover listing recent viewers.
  • Public element: <velt-view-analytics-dialog>
  • Wireframe tag: <velt-view-analytics-dialog-wireframe>
<VeltViewAnalyticsDialogWireframe
  velt-if="{componentConfig.treadsVisible}">
  <header>
    <velt-data field="componentConfig.userViews.length" /> viewers
  </header>
  <ul className="my-viewer-list">
    <li>
      <velt-data field="componentConfig.userViews.0.user.name" />
      <time><velt-data field="componentConfig.userViews.0.timestamp" /></time>
    </li>
  </ul>
</VeltViewAnalyticsDialogWireframe>

view-analytics-bottom-sheet

The mobile bottom-sheet variant of the dialog — same data, mobile UX.
  • Public element: <velt-view-analytics-bottom-sheet>
  • Wireframe tag: <velt-view-analytics-bottom-sheet-wireframe>
PropertyValue
Extra variablesSame as view-analytics-dialog.
shouldShowRenders when componentConfig.bottomSheetMode === true.

Putting it together

A typical View Analytics trigger that swaps the dialog / bottom-sheet variant based on platform, with a count badge and a custom viewer list:
<VeltViewAnalyticsWireframe>
  <button
    className="my-trigger"
    velt-class="'is-open': {componentConfig.treadsVisible}, 'is-phone': {componentConfig.isPhone}">
    <span>Viewed today</span>
    <span velt-if="{componentConfig.todayViewsCount} > 0">
      <velt-data field="componentConfig.todayViewsCount" />
    </span>
  </button>
</VeltViewAnalyticsWireframe>

<VeltViewAnalyticsDialogWireframe
  velt-if="{componentConfig.treadsVisible} && !{componentConfig.bottomSheetMode}">
  <header>
    <strong><velt-data field="componentConfig.userViews.length" /></strong> recent viewers
  </header>
</VeltViewAnalyticsDialogWireframe>

<VeltViewAnalyticsBottomSheetWireframe
  velt-if="{componentConfig.treadsVisible} && {componentConfig.bottomSheetMode}">
  <header>Viewers today</header>
</VeltViewAnalyticsBottomSheetWireframe>