@affino/treeview-vue

Vue adapter for @affino/treeview-core
1,051
Install
npm install @affino/treeview-vue
Latest Version:0.4.0
Vue:3
License:MIT
Last Updated:Apr 13, 2026
Links: GitHub  ·  npm
Maintainer: affino

@affino/treeview-vue

Vue composable wrappers for @affino/treeview-core.

The virtual adapter assumes a fixed row height and a fixed-height viewport. It keeps the visible window bounded and refreshes from core subscriptions; consumers remain responsible for rendering tree semantics and ARIA attributes.

Scripts

pnpm --filter @affino/treeview-vue build
pnpm --filter @affino/treeview-vue test

Search

useTreeviewController() and useVirtualTreeviewController() expose setSearchQuery(query), clearSearchQuery(), and getSearchMatchCount() from @affino/treeview-core. Virtual rows include matched metadata for direct search hits.

rowHeight is measured in CSS pixels and must be positive. overscan is a row count. The controller exposes single selection/active-node semantics inherited from the core.

Core result parity

The Vue controllers preserve the core result contracts. Patch registration can be used without reaching into the underlying core:

const registration = controller.registerNodes(nodes, { mode: "patch" })
if (registration.changed) {
  // Recompute only the projections affected by this registration.
}

const focus = controller.requestFocus(value)
if (!focus.ok) {
  // Handle missing, disabled, or boundary intents explicitly.
}

registerNodes() returns { changed, topologyChanged }. The request* methods return the same TreeviewActionResult as @affino/treeview-core; legacy imperative methods remain available for compatibility. The virtual controller refreshes its visible window after these operations while returning the original result.

Both controllers expose removeNodes(ids) (including subtree deletion) and batch(callback). Batches publish one final state notification, including when a nested callback throws; applied changes are not rolled back. Virtual row state updates synchronously after core notifications. Scroll-driven updates remain coalesced through animation frames.

Related Packages

@vizejs/ui

Accessible, headless, Native CSS-first UI primitives

23,323 908
@affino/diagram-vue

Vue adapter for @affino/diagram-core

649 0
@monolithrobotics/isoline

Headless, unstyled Vue 3 UI primitives. Behaviour and accessibility only — you b...

1,003 0
@elvora/vue

Elvora UI components for Vue 3 — same headless API as the React adapter, idiomat...

745
color-ui-vue

Vue color ui components based on Radix-vue

540 0

Version History

Version Released Vue License
0.4.0 ^3.3.0 MIT
0.3.0 ^3.3.0 MIT
0.2.1 ^3.3.0 MIT
0.2.0 ^3.3.0 MIT
0.1.0 ^3.3.0 MIT