---
title: "Saving state with useStorage · vuejs.school"
description: "Keep a ref in sync with localStorage so a note or a setting survives a reload, and add new fields without breaking old visitors."
canonical_url: "https://vuejs.school/learn/vueuse/saving-state-with-usestorage"
meta:
  "og:description": "Keep a ref in sync with localStorage so a note or a setting survives a reload, and add new fields without breaking old visitors."
  "og:image": "https://vuejs.school/_og/d/a_~U2F2aW5nIHN0YXRlIHdpdGggdXNlU3RvcmFnZSDCtyB2dWVqcy5zY2hvb2w%2Cc_OgCard.takumi%2Ctitle_Saving%2Bstate%2Bwith%2BuseStorage%2Cdescription_~S2VlcCBhIHJlZiBpbiBzeW5jIHdpdGggbG9jYWxTdG9yYWdlIHNvIGEgbm90ZSBvciBhIHNldHRpbmcgc3Vydml2ZXMgYSByZWxvYWQsIGFuZCBhZGQgbmV3IGZpZWxkcyB3aXRob3V0IGJyZWFraW5nIG9sZCB2aXNpdG9ycy4%2Ceyebrow_~VnVlVXNlIMK3IExlc3NvbiAyIG9mIDY%2Ctint_sand%2Cp_Ii9sZWFybi92dWV1c2Uvc2F2aW5nLXN0YXRlLXdpdGgtdXNlc3RvcmFnZSI%2Cs_e3xIwYL6_sx9zeXN.png"
  "og:image:alt": "Saving state with useStorage · vuejs.school"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Saving state with useStorage · vuejs.school"
  "twitter:image": "https://vuejs.school/_og/d/a_~U2F2aW5nIHN0YXRlIHdpdGggdXNlU3RvcmFnZSDCtyB2dWVqcy5zY2hvb2w%2Cc_OgCard.takumi%2Ctitle_Saving%2Bstate%2Bwith%2BuseStorage%2Cdescription_~S2VlcCBhIHJlZiBpbiBzeW5jIHdpdGggbG9jYWxTdG9yYWdlIHNvIGEgbm90ZSBvciBhIHNldHRpbmcgc3Vydml2ZXMgYSByZWxvYWQsIGFuZCBhZGQgbmV3IGZpZWxkcyB3aXRob3V0IGJyZWFraW5nIG9sZCB2aXNpdG9ycy4%2Ceyebrow_~VnVlVXNlIMK3IExlc3NvbiAyIG9mIDY%2Ctint_sand%2Cp_Ii9sZWFybi92dWV1c2Uvc2F2aW5nLXN0YXRlLXdpdGgtdXNlc3RvcmFnZSI%2Cs_e3xIwYL6_sx9zeXN.png"
  "twitter:image:alt": "Saving state with useStorage · vuejs.school"
---

> Index of every page on this site: [llms.txt](https://vuejs.school/llms.txt)

# **Saving state with useStorage**

Keep a ref in sync with localStorage so a note or a setting survives a reload, and add new fields without breaking old visitors.

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://vuejs.school/#website","@type":"WebSite","description":"A free AI-instructed school for Vue.js. Short tutorials, runnable code and quizzes that adapt to you.","name":"vuejs.school","url":"https://vuejs.school/","publisher":{"@id":"https://vuejs.school/#identity"}},{"@id":"https://vuejs.school/learn/vueuse/saving-state-with-usestorage#webpage","@type":"WebPage","description":"Keep a ref in sync with localStorage so a note or a setting survives a reload, and add new fields without breaking old visitors.","name":"Saving state with useStorage","url":"https://vuejs.school/learn/vueuse/saving-state-with-usestorage","breadcrumb":{"@id":"https://vuejs.school/learn/vueuse/saving-state-with-usestorage#breadcrumb"},"isPartOf":{"@id":"https://vuejs.school/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://vuejs.school/learn/vueuse/saving-state-with-usestorage"]}],"primaryImageOfPage":{"@id":"https://vuejs.school/#logo"}},{"@id":"https://vuejs.school/#identity","@type":"Organization","description":"A free AI-instructed school for Vue.js. Short tutorials, runnable code and quizzes that adapt to you.","name":"vuejs.school","url":"https://vuejs.school","logo":{"@id":"https://vuejs.school/#logo"}},{"@id":"https://vuejs.school/learn/vueuse/saving-state-with-usestorage#article","description":"Keep a ref in sync with localStorage so a note or a setting survives a reload, and add new fields without breaking old visitors.","headline":"Saving state with useStorage","inLanguage":"en","isAccessibleForFree":true,"thumbnailUrl":"https://vuejs.school/_og/d/a_~U2F2aW5nIHN0YXRlIHdpdGggdXNlU3RvcmFnZSDCtyB2dWVqcy5zY2hvb2w%2Cc_OgCard.takumi%2Ctitle_Saving%2Bstate%2Bwith%2BuseStorage%2Cdescription_~S2VlcCBhIHJlZiBpbiBzeW5jIHdpdGggbG9jYWxTdG9yYWdlIHNvIGEgbm90ZSBvciBhIHNldHRpbmcgc3Vydml2ZXMgYSByZWxvYWQsIGFuZCBhZGQgbmV3IGZpZWxkcyB3aXRob3V0IGJyZWFraW5nIG9sZCB2aXNpdG9ycy4%2Ceyebrow_~VnVlVXNlIMK3IExlc3NvbiAyIG9mIDY%2Ctint_sand%2Cp_Ii9sZWFybi92dWV1c2Uvc2F2aW5nLXN0YXRlLXdpdGgtdXNlc3RvcmFnZSI%2Cs_e3xIwYL6_sx9zeXN.png","@type":["Article","TechArticle"],"articleSection":["Composables"],"author":{"@id":"https://vuejs.school/#identity"},"image":{"@id":"https://vuejs.school/#/schema/image/1"},"isPartOf":{"@id":"https://vuejs.school/learn/vueuse/saving-state-with-usestorage#webpage"},"keywords":["useStorage()","serialization","mergeDefaults","initOnMounted"],"mainEntityOfPage":{"@id":"https://vuejs.school/learn/vueuse/saving-state-with-usestorage#webpage"},"publisher":{"@id":"https://vuejs.school/#identity"}},{"@id":"https://vuejs.school/learn/vueuse/saving-state-with-usestorage#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Skill tree","item":"https://vuejs.school/track","position":1},{"@type":"ListItem","name":"VueUse","item":"https://vuejs.school/track/vueuse","position":2},{"@type":"ListItem","name":"Saving state with useStorage","position":3}]},{"@id":"https://vuejs.school/#logo","@type":"ImageObject","caption":"vuejs.school","contentUrl":"https://vuejs.school/apple-touch-icon.png","inLanguage":"en","url":"https://vuejs.school/apple-touch-icon.png"},{"@id":"https://vuejs.school/#/schema/image/1","@type":"ImageObject","contentUrl":"https://vuejs.school/_og/d/a_~U2F2aW5nIHN0YXRlIHdpdGggdXNlU3RvcmFnZSDCtyB2dWVqcy5zY2hvb2w%2Cc_OgCard.takumi%2Ctitle_Saving%2Bstate%2Bwith%2BuseStorage%2Cdescription_~S2VlcCBhIHJlZiBpbiBzeW5jIHdpdGggbG9jYWxTdG9yYWdlIHNvIGEgbm90ZSBvciBhIHNldHRpbmcgc3Vydml2ZXMgYSByZWxvYWQsIGFuZCBhZGQgbmV3IGZpZWxkcyB3aXRob3V0IGJyZWFraW5nIG9sZCB2aXNpdG9ycy4%2Ceyebrow_~VnVlVXNlIMK3IExlc3NvbiAyIG9mIDY%2Ctint_sand%2Cp_Ii9sZWFybi92dWV1c2Uvc2F2aW5nLXN0YXRlLXdpdGgtdXNlc3RvcmFnZSI%2Cs_e3xIwYL6_sx9zeXN.png","inLanguage":"en","url":"https://vuejs.school/_og/d/a_~U2F2aW5nIHN0YXRlIHdpdGggdXNlU3RvcmFnZSDCtyB2dWVqcy5zY2hvb2w%2Cc_OgCard.takumi%2Ctitle_Saving%2Bstate%2Bwith%2BuseStorage%2Cdescription_~S2VlcCBhIHJlZiBpbiBzeW5jIHdpdGggbG9jYWxTdG9yYWdlIHNvIGEgbm90ZSBvciBhIHNldHRpbmcgc3Vydml2ZXMgYSByZWxvYWQsIGFuZCBhZGQgbmV3IGZpZWxkcyB3aXRob3V0IGJyZWFraW5nIG9sZCB2aXNpdG9ycy4%2Ceyebrow_~VnVlVXNlIMK3IExlc3NvbiAyIG9mIDY%2Ctint_sand%2Cp_Ii9sZWFybi92dWV1c2Uvc2F2aW5nLXN0YXRlLXdpdGgtdXNlc3RvcmFnZSI%2Cs_e3xIwYL6_sx9zeXN.png"}]}
```