Skip to main content
Vuetify0 is now a release candidate!
Vuetify0 Logo
Theme
Mode
Palettes
Accessibility
Vuetify One
Sign in to Vuetify One

Access premium tools across the Vuetify ecosystem — Bin, Play, Studio, and more.

Not a subscriber? See what's included

useProxyRegistry

A reactive proxy wrapper for registry collections that automatically updates refs when items are registered or unregistered.

Usage

The useProxyRegistry composable creates reactive objects that automatically sync with a registry’s state. It listens for registry changes and updates the reactive properties accordingly, making it ideal for template-driven UIs that need to react to registry mutations.

Important: The registry must have events: true enabled for the proxy to receive updates.

ts
import { createRegistry, useProxyRegistry } from '@vuetify/v0'

const registry = createRegistry({ events: true })
const proxy = useProxyRegistry(registry)

registry.register({ value: 'Item 1' })
registry.register({ value: 'Item 2' })

console.log(proxy.size) // 2
console.log(proxy.keys) // [id1, id2]

Architecture

useProxyRegistry creates a reactive proxy over registry collections:

Proxy Registry Flow

Use controls to zoom and pan. Click outside or press Escape to close.

Proxy Registry Flow

Reactivity

useProxyRegistry returns a fully reactive object that syncs with registry events. Use it to expose registry data in Vue templates.

PropertyReactiveNotes
keysUpdates on register/unregister
valuesUpdates on register/unregister/update
entriesUpdates on any ticket change
sizeUpdates on register/unregister
Tip

Deep vs shallow Pass { deep: true } for reactive(), or omit for shallowReactive() (default). Shallow is more performant when ticket internals don’t need tracking.

Examples

Notification Center

A notification center that manages an event-sourced list of items through createRegistry with events: true and exposes them reactively to the template via useProxyRegistry. Three notifications are seeded with onboard() on mount; the + Add button calls registry.register() with a random message and type; clicking the mail icon calls registry.upsert() to flip the read flag; dismiss calls registry.unregister(). The template iterates proxy.values — a reactive array that updates automatically on every registry mutation without any manual watch or event subscription in the component.

The debug panel at the top shows proxy.size, proxy.keys, and a toRef-derived unread count, making the reactivity boundary visible: all three update the moment the registry changes, driven entirely by the event bridge useProxyRegistry installs. The unread badge on the header demonstrates that derived values — computed from proxy.values via toRef — are also reactive without extra wiring.

Use useProxyRegistry any time a registry’s contents need to drive a v-for or a reactive count in a template. The alternative — reactive: true on the registry — carries a subtle cache-invalidation footgun (see the FAQ) that useProxyRegistry avoids entirely by listening to events rather than relying on Vue’s dep tracking of the internal Map. For selection composables like createSingle or createGroup, pass the selection instance directly since they extend createRegistry and support events: true the same way.

Notifications2
Proxy state
size3keysn-1, n-2, n-3unread2

Build succeeded

success · #0

Disk usage at 85%

warning · #1

New user signed up

info · #2

FAQ

Discord
Need help? Join our community for support and discussions ↗

API Reference

The following API details are for the useProxyRegistry composable.

Benchmarks

Every operation is profiled across multiple dataset sizes to measure real-world throughput. Each benchmark is assigned a performance tier—good, fast, blazing, or slow—and groups are scored by averaging their individual results so you can spot bottlenecks at a glance. This transparency helps you make informed decisions about which patterns scale for your use case. Learn more in the benchmarks guide.

View benchmark source↗

Was this page helpful?

Ctrl+/