Skip to main content
Vuetify0 v1.0 is here
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

toReactive

Converts a MaybeRef object to a reactive proxy with automatic ref unwrapping and Map/Set support.

Edit this page
Report a Bug
Open issues
View on GitHub
Copy Markdown

PreviewIntermediateJun 29, 2026

Usage

ts
import { ref } from 'vue'
import { toReactive } from '@vuetify/v0'

const state = ref({ name: 'John', age: 30 })
const rstate = toReactive(state)

console.log(rstate.name) // 'John' (no .value needed)

Architecture

toReactive creates a Proxy that unwraps ref values:

Reactive Proxy Flow

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

Reactive Proxy Flow

Reactivity

toReactive converts a MaybeRef into a fully reactive proxy with automatic ref unwrapping. This is the primary way to eliminate .value syntax.

BehaviorReactiveNotes
Object accessProperties are reactive, refs auto-unwrapped
Map operationsget/set/entries unwrap ref values
Set operationsIteration unwraps ref values
Array accessIndex access unwraps nested refs
Tip

When to use Use toReactive when you want to:

  • Eliminate .value in templates

  • Pass reactive state to non-Vue code expecting plain objects

  • Create reactive proxies over ref-wrapped collections

Examples

Reactive Settings Object

A settings panel that wraps a ref-based config object with toReactive so the template can read and write settings.theme, settings.fontSize, settings.language, and the two boolean toggles without .value. The theme selector, font size stepper, notification toggle, and sidebar toggle all mutate the proxy directly (settings.theme = t, settings.fontSize++), and the debug panel below shows the underlying config.value updating in real time — confirming that proxy writes flow back to the source ref. A change history log records each snapshot, making it easy to see that watch(config, ...) still fires correctly even though the writes come through the proxy.

Reach for toReactive when you have a ref-wrapped object and want to eliminate .value in templates or in non-Vue code that expects a plain object interface. It is especially useful for composable return values: instead of returning { name: ref(''), age: ref(0) } and having callers write state.name.value, return toReactive(ref({ name: '', age: 0 })). The proxy also handles Map and Setget, set, and iteration all unwrap ref values stored as map entries. For the inverse direction — normalizing a single value or array into a consistent array shape — see toArray.

Mutate the reactive proxy directly — changes flow back to the source ref.

Theme
Language
Font size
14
Notifications
Sidebar
Source ref
{
  "theme": "dark",
  "language": "en",
  "fontSize": 14,
  "notifications": true,
  "sidebar": true
}

FAQ

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

API Reference

The following API details are for the toReactive composable.
Was this page helpful?

© 2016-1970 Vuetify, LLC
Services
Ctrl+/