Vue.js is a progressive JavaScript framework for building user interfaces. Unlike monolithic frameworks, Vue is designed to be incrementally adoptable: you can sprinkle it onto a single page to add interactivity, or use it to power a full single-page application with routing, state management, and a build pipeline. Vue 3, the current major version, is fast, small (around 34 KB min+gzip), and built around a reactivity system that automatically keeps your UI in sync with your data.
.vue file.Perfect for experiments or enhancing an existing page. Drop a script tag into any HTML file:
<div id="app">{{ message }}</div>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
const { createApp, ref } = Vue
createApp({
setup() {
const message = ref('Hello Vue 3!')
return { message }
}
}).mount('#app')
</script>Open the file in a browser and you will see Hello Vue 3! rendered. The double curly braces are Vue's text interpolation syntax, and ref() creates a reactive value.
For anything beyond a demo, scaffold a project with the official tooling. You need Node.js 18 or newer installed:
npm create vue@latest my-vue-app
cd my-vue-app
npm install
npm run devThe scaffolding wizard asks whether you want TypeScript, Vue Router, Pinia, and testing tools -- you can say no to everything for now. npm run dev starts a dev server (usually at http://localhost:5173) with hot module replacement, so edits appear in the browser instantly without a full reload.
Open src/App.vue and you will find the three building blocks of every Vue component:
<script setup>
import { ref } from 'vue'
const count = ref(0)
</script>
<template>
<button @click="count++">Count is: {{ count }}</button>
</template>
<style scoped>
button { font-weight: bold; }
</style><script setup> is the modern Composition API syntax. Anything you declare here is automatically available in the template.<template> holds your HTML with Vue's extensions such as {{ count }} and @click.<style scoped> keeps CSS local to this component so styles never leak.src/main.js is the entry point. It creates the application instance and mounts it onto the #app element in index.html:
import { createApp } from 'vue'
import App from './App.vue'
createApp(App).mount('#app')Every Vue app starts exactly like this: one root component, one mount call. Plugins such as the router or Pinia are registered on the app instance before mount() is called.
Install the Vue - Official extension for VS Code (formerly Volar). It provides syntax highlighting, IntelliSense, and error checking inside .vue files. In the browser, add the Vue Devtools extension to inspect component trees, props, and reactive state while you develop.
npm create vue@latest scaffolds a modern project with a dev server and hot reload..vue file.createApp(App).mount('#app') is how every Vue application boots.<script setup> with the Composition API is the recommended way to write components today.Next up: in Template Syntax and Reactivity we will dig into interpolation, expressions, and how Vue's reactivity system tracks and updates your data.