---
title: "Write a composable like VueUse · vuejs.school"
description: "Give your own composables the VueUse shape, with flexible inputs, an options object, refs and controls out, a browser guard and quiet cleanup."
canonical_url: "https://vuejs.school/learn/vueuse/write-a-composable-like-vueuse"
meta:
  "og:description": "Give your own composables the VueUse shape, with flexible inputs, an options object, refs and controls out, a browser guard and quiet cleanup."
  "og:image": "https://vuejs.school/_og/d/a_~V3JpdGUgYSBjb21wb3NhYmxlIGxpa2UgVnVlVXNlIMK3IHZ1ZWpzLnNjaG9vbA%2Cc_OgCard.takumi%2Ctitle_Write%2Ba%2Bcomposable%2Blike%2BVueUse%2Cdescription_~R2l2ZSB5b3VyIG93biBjb21wb3NhYmxlcyB0aGUgVnVlVXNlIHNoYXBlLCB3aXRoIGZsZXhpYmxlIGlucHV0cywgYW4gb3B0aW9ucyBvYmplY3QsIHJlZnMgYW5kIGNvbnRyb2xzIG91dCwgYSBicm93c2VyIGd1YXJkIGFuZCBxdWlldCBjbGVhbnVwLg%2Ceyebrow_~VnVlVXNlIMK3IExlc3NvbiA2IG9mIDY%2Ctint_sand%2Cp_Ii9sZWFybi92dWV1c2Uvd3JpdGUtYS1jb21wb3NhYmxlLWxpa2UtdnVldXNlIg%2Cs_vBpAF6doH5IExqiE.png"
  "og:image:alt": "Write a composable like VueUse · vuejs.school"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Write a composable like VueUse · vuejs.school"
  "twitter:image": "https://vuejs.school/_og/d/a_~V3JpdGUgYSBjb21wb3NhYmxlIGxpa2UgVnVlVXNlIMK3IHZ1ZWpzLnNjaG9vbA%2Cc_OgCard.takumi%2Ctitle_Write%2Ba%2Bcomposable%2Blike%2BVueUse%2Cdescription_~R2l2ZSB5b3VyIG93biBjb21wb3NhYmxlcyB0aGUgVnVlVXNlIHNoYXBlLCB3aXRoIGZsZXhpYmxlIGlucHV0cywgYW4gb3B0aW9ucyBvYmplY3QsIHJlZnMgYW5kIGNvbnRyb2xzIG91dCwgYSBicm93c2VyIGd1YXJkIGFuZCBxdWlldCBjbGVhbnVwLg%2Ceyebrow_~VnVlVXNlIMK3IExlc3NvbiA2IG9mIDY%2Ctint_sand%2Cp_Ii9sZWFybi92dWV1c2Uvd3JpdGUtYS1jb21wb3NhYmxlLWxpa2UtdnVldXNlIg%2Cs_vBpAF6doH5IExqiE.png"
  "twitter:image:alt": "Write a composable like VueUse · vuejs.school"
---

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

# **Write a composable like VueUse**

Give your own composables the VueUse shape, with flexible inputs, an options object, refs and controls out, a browser guard and quiet cleanup.

```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/write-a-composable-like-vueuse#webpage","@type":"WebPage","description":"Give your own composables the VueUse shape, with flexible inputs, an options object, refs and controls out, a browser guard and quiet cleanup.","name":"Write a composable like VueUse","url":"https://vuejs.school/learn/vueuse/write-a-composable-like-vueuse","breadcrumb":{"@id":"https://vuejs.school/learn/vueuse/write-a-composable-like-vueuse#breadcrumb"},"isPartOf":{"@id":"https://vuejs.school/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://vuejs.school/learn/vueuse/write-a-composable-like-vueuse"]}],"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/write-a-composable-like-vueuse#article","description":"Give your own composables the VueUse shape, with flexible inputs, an options object, refs and controls out, a browser guard and quiet cleanup.","headline":"Write a composable like VueUse","inLanguage":"en","isAccessibleForFree":true,"thumbnailUrl":"https://vuejs.school/_og/d/a_~V3JpdGUgYSBjb21wb3NhYmxlIGxpa2UgVnVlVXNlIMK3IHZ1ZWpzLnNjaG9vbA%2Cc_OgCard.takumi%2Ctitle_Write%2Ba%2Bcomposable%2Blike%2BVueUse%2Cdescription_~R2l2ZSB5b3VyIG93biBjb21wb3NhYmxlcyB0aGUgVnVlVXNlIHNoYXBlLCB3aXRoIGZsZXhpYmxlIGlucHV0cywgYW4gb3B0aW9ucyBvYmplY3QsIHJlZnMgYW5kIGNvbnRyb2xzIG91dCwgYSBicm93c2VyIGd1YXJkIGFuZCBxdWlldCBjbGVhbnVwLg%2Ceyebrow_~VnVlVXNlIMK3IExlc3NvbiA2IG9mIDY%2Ctint_sand%2Cp_Ii9sZWFybi92dWV1c2Uvd3JpdGUtYS1jb21wb3NhYmxlLWxpa2UtdnVldXNlIg%2Cs_vBpAF6doH5IExqiE.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/write-a-composable-like-vueuse#webpage"},"keywords":["MaybeRefOrGetter","options object","pause and resume","tryOnScopeDispose()"],"mainEntityOfPage":{"@id":"https://vuejs.school/learn/vueuse/write-a-composable-like-vueuse#webpage"},"publisher":{"@id":"https://vuejs.school/#identity"}},{"@id":"https://vuejs.school/learn/vueuse/write-a-composable-like-vueuse#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":"Write a composable like VueUse","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_~V3JpdGUgYSBjb21wb3NhYmxlIGxpa2UgVnVlVXNlIMK3IHZ1ZWpzLnNjaG9vbA%2Cc_OgCard.takumi%2Ctitle_Write%2Ba%2Bcomposable%2Blike%2BVueUse%2Cdescription_~R2l2ZSB5b3VyIG93biBjb21wb3NhYmxlcyB0aGUgVnVlVXNlIHNoYXBlLCB3aXRoIGZsZXhpYmxlIGlucHV0cywgYW4gb3B0aW9ucyBvYmplY3QsIHJlZnMgYW5kIGNvbnRyb2xzIG91dCwgYSBicm93c2VyIGd1YXJkIGFuZCBxdWlldCBjbGVhbnVwLg%2Ceyebrow_~VnVlVXNlIMK3IExlc3NvbiA2IG9mIDY%2Ctint_sand%2Cp_Ii9sZWFybi92dWV1c2Uvd3JpdGUtYS1jb21wb3NhYmxlLWxpa2UtdnVldXNlIg%2Cs_vBpAF6doH5IExqiE.png","inLanguage":"en","url":"https://vuejs.school/_og/d/a_~V3JpdGUgYSBjb21wb3NhYmxlIGxpa2UgVnVlVXNlIMK3IHZ1ZWpzLnNjaG9vbA%2Cc_OgCard.takumi%2Ctitle_Write%2Ba%2Bcomposable%2Blike%2BVueUse%2Cdescription_~R2l2ZSB5b3VyIG93biBjb21wb3NhYmxlcyB0aGUgVnVlVXNlIHNoYXBlLCB3aXRoIGZsZXhpYmxlIGlucHV0cywgYW4gb3B0aW9ucyBvYmplY3QsIHJlZnMgYW5kIGNvbnRyb2xzIG91dCwgYSBicm93c2VyIGd1YXJkIGFuZCBxdWlldCBjbGVhbnVwLg%2Ceyebrow_~VnVlVXNlIMK3IExlc3NvbiA2IG9mIDY%2Ctint_sand%2Cp_Ii9sZWFybi92dWV1c2Uvd3JpdGUtYS1jb21wb3NhYmxlLWxpa2UtdnVldXNlIg%2Cs_vBpAF6doH5IExqiE.png"}]}
```