---
title: "Your first component · vuejs.school"
description: "Write a single-file component with script setup, a template and scoped styles, and print values in the template."
canonical_url: "https://vuejs.school/learn/beginner/your-first-component"
meta:
  "og:description": "Write a single-file component with script setup, a template and scoped styles, and print values in the template."
  "og:image": "https://vuejs.school/_og/d/a_~WW91ciBmaXJzdCBjb21wb25lbnQgwrcgdnVlanMuc2Nob29s%2Cc_OgCard.takumi%2Ctitle_Your%2Bfirst%2Bcomponent%2Cdescription_~V3JpdGUgYSBzaW5nbGUtZmlsZSBjb21wb25lbnQgd2l0aCBzY3JpcHQgc2V0dXAsIGEgdGVtcGxhdGUgYW5kIHNjb3BlZCBzdHlsZXMsIGFuZCBwcmludCB2YWx1ZXMgaW4gdGhlIHRlbXBsYXRlLg%2Ceyebrow_~QmVnaW5uZXIgwrcgTGVzc29uIDEgb2YgMTE%2Ctint_mint%2Cp_Ii9sZWFybi9iZWdpbm5lci95b3VyLWZpcnN0LWNvbXBvbmVudCI%2Cs_CUGcxIdJC9vO4uGo.png"
  "og:image:alt": "Your first component · vuejs.school"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Your first component · vuejs.school"
  "twitter:image": "https://vuejs.school/_og/d/a_~WW91ciBmaXJzdCBjb21wb25lbnQgwrcgdnVlanMuc2Nob29s%2Cc_OgCard.takumi%2Ctitle_Your%2Bfirst%2Bcomponent%2Cdescription_~V3JpdGUgYSBzaW5nbGUtZmlsZSBjb21wb25lbnQgd2l0aCBzY3JpcHQgc2V0dXAsIGEgdGVtcGxhdGUgYW5kIHNjb3BlZCBzdHlsZXMsIGFuZCBwcmludCB2YWx1ZXMgaW4gdGhlIHRlbXBsYXRlLg%2Ceyebrow_~QmVnaW5uZXIgwrcgTGVzc29uIDEgb2YgMTE%2Ctint_mint%2Cp_Ii9sZWFybi9iZWdpbm5lci95b3VyLWZpcnN0LWNvbXBvbmVudCI%2Cs_CUGcxIdJC9vO4uGo.png"
  "twitter:image:alt": "Your first component · vuejs.school"
---

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

# **Your first component**

Write a single-file component with script setup, a template and scoped styles, and print values in the template.

```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/beginner/your-first-component#webpage","@type":"WebPage","description":"Write a single-file component with script setup, a template and scoped styles, and print values in the template.","name":"Your first component","url":"https://vuejs.school/learn/beginner/your-first-component","breadcrumb":{"@id":"https://vuejs.school/learn/beginner/your-first-component#breadcrumb"},"isPartOf":{"@id":"https://vuejs.school/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://vuejs.school/learn/beginner/your-first-component"]}],"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/beginner/your-first-component#article","description":"Write a single-file component with script setup, a template and scoped styles, and print values in the template.","headline":"Your first component","inLanguage":"en","isAccessibleForFree":true,"thumbnailUrl":"https://vuejs.school/_og/d/a_~WW91ciBmaXJzdCBjb21wb25lbnQgwrcgdnVlanMuc2Nob29s%2Cc_OgCard.takumi%2Ctitle_Your%2Bfirst%2Bcomponent%2Cdescription_~V3JpdGUgYSBzaW5nbGUtZmlsZSBjb21wb25lbnQgd2l0aCBzY3JpcHQgc2V0dXAsIGEgdGVtcGxhdGUgYW5kIHNjb3BlZCBzdHlsZXMsIGFuZCBwcmludCB2YWx1ZXMgaW4gdGhlIHRlbXBsYXRlLg%2Ceyebrow_~QmVnaW5uZXIgwrcgTGVzc29uIDEgb2YgMTE%2Ctint_mint%2Cp_Ii9sZWFybi9iZWdpbm5lci95b3VyLWZpcnN0LWNvbXBvbmVudCI%2Cs_CUGcxIdJC9vO4uGo.png","@type":["Article","TechArticle"],"articleSection":["Components"],"author":{"@id":"https://vuejs.school/#identity"},"image":{"@id":"https://vuejs.school/#/schema/image/1"},"isPartOf":{"@id":"https://vuejs.school/learn/beginner/your-first-component#webpage"},"keywords":["\u003Cscript setup>","template","SFC","interpolation"],"mainEntityOfPage":{"@id":"https://vuejs.school/learn/beginner/your-first-component#webpage"},"publisher":{"@id":"https://vuejs.school/#identity"}},{"@id":"https://vuejs.school/learn/beginner/your-first-component#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Skill tree","item":"https://vuejs.school/track","position":1},{"@type":"ListItem","name":"Beginner","item":"https://vuejs.school/track/beginner","position":2},{"@type":"ListItem","name":"Your first component","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_~WW91ciBmaXJzdCBjb21wb25lbnQgwrcgdnVlanMuc2Nob29s%2Cc_OgCard.takumi%2Ctitle_Your%2Bfirst%2Bcomponent%2Cdescription_~V3JpdGUgYSBzaW5nbGUtZmlsZSBjb21wb25lbnQgd2l0aCBzY3JpcHQgc2V0dXAsIGEgdGVtcGxhdGUgYW5kIHNjb3BlZCBzdHlsZXMsIGFuZCBwcmludCB2YWx1ZXMgaW4gdGhlIHRlbXBsYXRlLg%2Ceyebrow_~QmVnaW5uZXIgwrcgTGVzc29uIDEgb2YgMTE%2Ctint_mint%2Cp_Ii9sZWFybi9iZWdpbm5lci95b3VyLWZpcnN0LWNvbXBvbmVudCI%2Cs_CUGcxIdJC9vO4uGo.png","inLanguage":"en","url":"https://vuejs.school/_og/d/a_~WW91ciBmaXJzdCBjb21wb25lbnQgwrcgdnVlanMuc2Nob29s%2Cc_OgCard.takumi%2Ctitle_Your%2Bfirst%2Bcomponent%2Cdescription_~V3JpdGUgYSBzaW5nbGUtZmlsZSBjb21wb25lbnQgd2l0aCBzY3JpcHQgc2V0dXAsIGEgdGVtcGxhdGUgYW5kIHNjb3BlZCBzdHlsZXMsIGFuZCBwcmludCB2YWx1ZXMgaW4gdGhlIHRlbXBsYXRlLg%2Ceyebrow_~QmVnaW5uZXIgwrcgTGVzc29uIDEgb2YgMTE%2Ctint_mint%2Cp_Ii9sZWFybi9iZWdpbm5lci95b3VyLWZpcnN0LWNvbXBvbmVudCI%2Cs_CUGcxIdJC9vO4uGo.png"}]}
```