createApp creates a Vue application instance. .mount('#app') attaches it to a DOM element.
The template option defines the component's HTML. Vue renders it inside the element you mount to.Vue.js Playground — Learn Vue 3 in Your Browser, Free
A free interactive Vue 3 playground with 40 guided lessons — Options API, Composition API, composables, Teleport, custom directives, and 4 real mini-projects. No install. No Node.js.
What's included
Features
About this tool
Learn Vue 3 Online Without Installing Anything — 40 Lessons, Live Preview
Most Vue tutorials tell you to open a terminal, run npm create vue@latest, configure Vite, and install a handful of packages before writing a single line of code. This playground skips all of that. Vue 3 loads from CDN inside a sandboxed preview pane — open the page and you are already writing and running Vue code. The 40 lessons are structured to take you from your first createApp() call through composables, Teleport, custom directives, and four complete mini-project applications.
Getting Started — createApp, interpolation, data reactivity, methods
The first four lessons establish the mental model that makes Vue predictable: the Vue instance owns your data, the template is a reactive view of that data, and when data changes the DOM updates automatically. You write your first createApp call, see template interpolation with {{ }} render live, modify a reactive data property and watch the UI respond, and attach event handlers with methods. These four lessons alone eliminate the confusion most beginners have about how Vue wires data to the DOM.
Template Directives — v-bind, v-if, v-show, v-for, v-on, v-model
Six dedicated directive lessons, each interactive. v-bind — drag a range slider and watch an image's width attribute update live as you drag. v-if vs v-show — toggle a checkbox and open DevTools to see that v-if removes the element entirely while v-show sets display:none. v-for — edit a search input and watch the list filter in real time. v-on — click, hover, and keydown events demonstrated with a keyboard shortcut detector. v-model — a form with text, checkbox, radio, and select inputs all bound two-way simultaneously.
Computed & Watch — computed properties, watch, watchEffect
Three lessons on derived state and side effects. A computed property for a live character counter. A watcher that fires a debounced search when a query string changes. A watchEffect that automatically tracks its dependencies without listing them explicitly. Understanding the difference between these three is what separates Vue beginners from developers who write clean, efficient templates.
Components — child components, props, emits
Three lessons on Vue's component model. You register a child component inside a parent, pass data down with props (including type, required, and default validation), and pass data back up with $emit. A complete rating-star widget demonstrates a realistic parent–child communication pattern where the child emits a rating and the parent stores it reactively.
Lifecycle Hooks — onMounted, full lifecycle sequence
Two lessons. The first shows onMounted fetching simulated API data after the component renders. The second visualises the full lifecycle sequence — beforeCreate, created, beforeMount, mounted, beforeUpdate, updated, beforeUnmount, unmounted — as a live log you trigger by interacting with the component.
Composition API — ref, reactive, composables, Options vs Composition picker
Four lessons including the most important lesson in the playground: a side-by-side picker where you toggle between the same todo application written in the Options API and the Composition API. Switching back and forth with the picker makes the mental mapping between data() → ref(), methods → plain functions, computed → computed(), watch → watch() completely concrete. The composables lesson builds useCounter and useLocalStorage from scratch and mounts them in two independent component instances — showing how stateful logic is now just a function call.
Component Patterns — slots, provide/inject
Two lessons on passing content and data through the component tree. Named slots for a Card component with separate header, body, and footer slots. Provide/inject for a theme token passed from a root provider through multiple intermediate components down to deeply nested consumers — no prop drilling.
Forms — form handling with v-model
A full form lesson covering text, email, checkbox, radio groups, and a <select> dropdown. All fields bound with v-model. A computed property derives a live summary object. A submit handler validates presence and logs the result. Practical and directly applicable to any real form you will build.
Advanced Vue — dynamic components, transition animations
Dynamic components with <component :is="currentTab"> and <KeepAlive> to preserve state when switching tabs. The transitions lesson demonstrates <Transition> with custom name attributes and CSS classes for enter/leave animations — including a fade, a slide, and a bouncing list item transition with <TransitionGroup>.
Setup Function — prop validation, emits with setup(), template refs
Three lessons on the <script setup> mental model using the Options API style of setup(props, { emit }). Prop validation with runtime type checking. emit inside setup() for a dismissible alert component. ref() as a template ref with onMounted to auto-focus an input — a pattern every form builder needs.
Advanced Patterns — Teleport, custom directives, v-memo, async components
Four lessons on patterns that separate proficient Vue developers from beginners. Teleport renders a modal at <body> level while the component that controls it sits deep in the tree. Custom directives v-focus, v-highlight, and v-tooltip are built with mounted/updated/unmounted hooks. v-memo skips re-rendering rows in a 500-item list unless specific dependencies change — a real performance pattern. Async components with defineAsyncComponent and <Suspense> demonstrate code-splitting with a loading fallback.
Mini-Projects — four complete applications
Four full applications that combine everything you have learned. A Todo App with localStorage persistence, active/done filtering, and a delete-all button. A Searchable Sortable Table using a single computed property that filters and sorts 10 employees simultaneously. A Theme Switcher using provide/inject reactive tokens so nested components switch between light, dark, and system themes without prop drilling. A Multi-step Form Wizard with four steps (Account, Plan, Payment, Review), per-step validation, a progress bar, and a final review screen that summarises all inputs before submission.
Every lesson includes a Quick Check multiple-choice question to reinforce the concept. Progress and your current lesson are saved to localStorage automatically. A Share button encodes your editor code as a base64 URL you can send to anyone. All code runs fully in your browser — no data is uploaded to any server.
Step by step
How to Use
- 1Open the playground — no install requiredNavigate to the Vue Playground. Vue 3 is already loaded from CDN inside the preview pane. No terminal, no npm install, no Vite configuration. You are writing real Vue 3 the moment the page loads.
- 2Pick a lesson from the sidebarThe left sidebar lists all 40 lessons grouped into 13 chapters. Start at "Hello Vue" if you are new to Vue, or jump directly to any chapter that matches your current level — Composition API, Teleport, or Mini-Projects. Use the search box to find a specific topic.
- 3Read the concept explanationA collapsible panel above the editor explains the Vue concept for that lesson in plain English — what the feature does, why it exists, and key things to remember. Each explanation is short and focused so you can get to the code quickly.
- 4Interact with the live previewThe starter code is already running in the preview pane. Click buttons, type in inputs, drag sliders, toggle checkboxes — every lesson is interactive. You can explore the behaviour before changing a single line of code.
- 5Edit the code and experimentModify the template, change data values, add a new method, swap
v-ifforv-show, or try a composable. The preview updates automatically within 700ms. If something breaks, click Reset to restore the lesson's original code. - 6Use the Options vs Composition pickerWhen you reach the "Options API vs Composition API" picker lesson, toggle between the two implementations of the same todo app. Switching back and forth makes the mental mapping between the two styles completely concrete — you see exactly what
data()becomes, whatmethodsbecome, and howcomputedmaps to Composition API equivalents. - 7Answer the Quick CheckAfter the preview pane, every lesson has a multiple-choice question that tests your understanding of the core concept. Answer it before marking the lesson done — it takes 30 seconds and helps the concept stick.
- 8Build the mini-projects and share your codeIn the Mini-Projects chapter, work through all four full applications. When you have a snippet worth saving or sharing, click the Share button to generate a base64 URL. Paste it in a message or bookmark it — the link reopens the playground with your exact code in the editor.
Real-world uses
Common Use Cases
Got questions?
Frequently Asked Questions
No. Vue 3 loads from CDN inside the preview pane. There is nothing to install — no Node.js, no npm, no terminal. Open the page and start writing Vue code immediately.
Both. The first chapters use the Options API (data(), methods, computed, watch) which is easier for beginners. Later chapters introduce the Composition API (setup(), ref, reactive, watchEffect) and composables. A dedicated picker lesson shows the exact same application built in both styles side by side so you can compare them directly.
40 lessons across 13 chapters: Getting Started (createApp, interpolation, data reactivity, methods), Template Directives (v-bind, v-if, v-show, v-for, v-on, v-model), Computed & Watch (computed, watch, watchEffect), Class & Style binding, Components (child components, props, emits), Lifecycle Hooks (onMounted, full lifecycle sequence), Composition API (ref, reactive, composables, Options vs Composition picker), Component Patterns (slots, provide/inject), Forms, Advanced Vue (dynamic components, transitions), Setup Function patterns (prop validation, emits, template refs), Advanced Patterns (Teleport, custom directives, v-memo, async components), and Mini-Projects (Todo App, Searchable Table, Theme Switcher, Multi-step Form Wizard).
ref() wraps any value in a reactive container — access it via .value in JavaScript, though the template unwraps it automatically. reactive() makes an entire object reactive without a .value wrapper. Use ref() for individual values or when you need to reassign the whole container. Use reactive() for groups of related properties on an object.
v-if removes the element from the DOM entirely when the condition is false — nothing is rendered. v-show keeps the element in the DOM but sets display:none. Use v-if when the condition rarely changes to avoid rendering overhead. Use v-show for elements that toggle frequently to avoid repeated DOM insertion and removal.
Composables are functions using the Composition API to encapsulate reusable stateful logic — by convention they start with 'use' (e.g. useCounter, useFetch, useLocalStorage). Unlike mixins, composables have no naming conflicts, make data sources explicit, and can receive arguments. The playground builds two composables from scratch and shows them shared across multiple component instances.
Teleport is a built-in Vue component that renders its content at a different location in the DOM — specified by the to prop (e.g. to="body"). This is essential for modals, tooltips, and dropdowns that need to escape overflow:hidden or z-index stacking contexts. The Advanced Patterns chapter has a complete modal example using Teleport.
Custom directives attach reusable DOM-manipulation behaviour to elements using the v-name syntax. You define lifecycle hooks (mounted, updated, unmounted) that receive the element and a binding object. The playground demonstrates v-focus (auto-focus on mount), v-highlight (background colour via binding), and v-tooltip (hover tooltip creation).
Yes. The Share button in the toolbar encodes your current editor code as a base64 string in the URL (?c=...) and copies the link to your clipboard. Anyone who opens that URL will see exactly the same code in the editor. Share links work for any code — not just lesson starters.
Yes. Vue becomes much easier if you already understand functions, arrays, objects, events, and basic DOM manipulation. The playground assumes JavaScript fundamentals. If you need to build that foundation first, the JavaScript Playground on this site covers all of it with 60 interactive lessons.
Yes. Completed lessons and your current position are saved to localStorage automatically. When you return you will resume exactly where you left off. No login or account required. All code runs fully in your browser — no data is uploaded.