> Canonical URL: https://codingcat.dev/course/intro-to-svelte/lesson/svelte-basics-props

# Svelte Basics - Props | Intro to Svelte | CodingCat.dev Course

[🧶 Intro to Svelte](/course/intro-to-svelte)Section 3.6 · Lesson 13 of 14[![](/logos/tags/svelte-symbol-light.svg)![](/logos/tags/svelte-symbol-dark.svg)Svelte](/topic/svelte)[← Prev Lesson](/course/intro-to-svelte/lesson/svelte-basics-reactivity)[Next Lesson →](/course/intro-to-svelte/lesson/svelte-basics-slots)

# Svelte Basics - Props

![](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/5e283fb0d0ffe55c9c179aca147a1c03dd88d599-1920x1080.png?w=1920&h=1080&q=82&fit=max&auto=format)[@CodingCatDev62.5K / 100K Subscribers Goal](https://www.youtube.com/@codingcatdev?sub_confirmation=1)[Subscribe on YouTube→](https://www.youtube.com/@codingcatdev?sub_confirmation=1)[Watch on YouTube App ↗](https://www.youtube.com/watch?v=SBLnGV4ld2Q&list=UUnKZ8gEb78zXKMi1ns-IQ2g)Lesson 13 / 14Course Lessons Outline▾1Section 1
- [1.1VSCode Extensions and Settings](/course/intro-to-svelte/lesson/svelte-fundamentals-vscode-extensions-and-settings)

2Fundamentals
- [2.1Fundamentals - What is Svelte](/course/intro-to-svelte/lesson/fundamentals-what-is-svelte)
- [2.2Fundamentals - Why SvelteKit](/course/intro-to-svelte/lesson/fundamentals-why-sveltekit)
- [2.3Fundamentals - Benefits of SvelteKit](/course/intro-to-svelte/lesson/fundamentals-benefits-of-sveltekit)
- [2.4Fundamentals - Performance](/course/intro-to-svelte/lesson/fundamentals-performance)
- [2.5Fundamentals - File Based Routing](/course/intro-to-svelte/lesson/fundamentals-file-based-routing)
- [2.6Svelte Fundamentals - Styling in Svelte](/course/intro-to-svelte/lesson/fundamentals-styling-in-sveltekit)

3Svelte Basics
- [3.1Svelte Basics](/course/intro-to-svelte/lesson/svelte-basics-getting-started)
- [3.2Svelte Basics - Sugar Syntax Markup](/course/intro-to-svelte/lesson/svelte-basics-sugar-syntax-markup)
- [3.3Svelte Basics - Sugar Syntax Logic and Each Blocks](/course/intro-to-svelte/lesson/svelte-basics-sugar-syntax-logic-each-block)
- [3.4Svelte Basics - Sugar Syntax Await and Key Blocks](/course/intro-to-svelte/lesson/svelte-basics-sugar-syntax-await-and-key-blocks)
- [3.5Svelte Basics - Reactivity](/course/intro-to-svelte/lesson/svelte-basics-reactivity)
- [3.6Svelte Basics - Props](/course/intro-to-svelte/lesson/svelte-basics-props)
- [3.7Svelte Basics - Slots](/course/intro-to-svelte/lesson/svelte-basics-slots)

## Props

Before we talk about how to use props in Svelte, let’s review what a prop is. Props is short for properties and they are used to pass data between components. Variables and functions declared in a svelte file are only available inside that file unless we explicitly “export” them. We add the export keyword to the front of the declaration to allow other components to access it. This follows the same principle as modules where we export out and then import where we want to use it.

## Default Values

By default these values will be undefined and you will get a warning in development if you don’t pass a value to the component. To give a prop a default value, we simply set it to a value when we declare it. Here we gave prop a default value of the string prop and set count to 0.

## Using Props

To use the prop in another component, we import it and can then pass along different values. Here we gave prop a value of New Count and set the count to 3.

✏️ Visual Architecture Diagram

## how this course connects together.

Follow AJ through the layered stack topology from input contract to production output.

Let’s build it!✏️ Architecture Diagram: Intro to Svelte: Svelte Basics - PropsLAYERED SYSTEM STACKARCHITECTURE DIAGRAM[Diagram Walkthrough]Content-driven layered-stack diagram for Intro to Svelte: Svelte Basics - Props: Svelte Basics -> Intro to Svelte -> Verified Production Artifact.AAA Contrast Verified

## related deep dives.

[View All&rarr;](/blog)[![Remotion in Production: Building & Rendering Videos with React](https://cdn.sanity.io/images/hfh83o0w/production/9accd4b53c34c1fe6498bee212c1fbdfe98cf099-1376x768.png?w=1376&q=82&fit=max&auto=format)](/course/remotion-react-video-production)November 4, 2026[![](/logos/tags/typescript-symbol-light.svg)![](/logos/tags/typescript-symbol-dark.svg)TypeScript](/topic/typescript)[#AI & Agents](/topic/ai)[![](/logos/tags/react-symbol-light.svg)![](/logos/tags/react-symbol-dark.svg)React](/topic/react)

### [Remotion in Production: Building & Rendering Videos with React](/course/remotion-react-video-production)

Turn React components into frame-accurate 60fps MP4 videos. Master Remotion Compositions, Sequences, spring physics, dynamic data props, and headless rendering.

[![Alex Patterson](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/a606dfaa381aab08ddbe16a33fe1d3e1fb37c927-400x400.jpg?w=96&h=96&q=82&fit=max&auto=format)Alex Patterson](/author/alex-patterson)[![The Odin Project 6: Modern React 19, State Architecture & TypeScript](https://cdn.sanity.io/images/hfh83o0w/production/1a3aad1e42061d9c384f723cdec562e1aa2afd24-1376x768.png?w=1376&q=82&fit=max&auto=format)](/course/odin-modern-react-and-typescript)November 4, 2026[![](/logos/tags/react-symbol-light.svg)![](/logos/tags/react-symbol-dark.svg)React](/topic/react)[![](/logos/tags/typescript-symbol-light.svg)![](/logos/tags/typescript-symbol-dark.svg)TypeScript](/topic/typescript)[![](/logos/tags/astro-symbol-light.svg)![](/logos/tags/astro-symbol-dark.svg)Astro](/topic/astro)[+1](/course/odin-modern-react-and-typescript)

### [The Odin Project 6: Modern React 19, State Architecture & TypeScript](/course/odin-modern-react-and-typescript)

Master React 19 components, strict TypeScript props, derived state vs. useEffect traps, Server Actions, and island hydration in Astro.

[![Alex Patterson](https://cdn.sanity.io/media-libraries/mlttp0BZbCpV/images/a606dfaa381aab08ddbe16a33fe1d3e1fb37c927-400x400.jpg?w=96&h=96&q=82&fit=max&auto=format)Alex Patterson](/author/alex-patterson)[Course Outline](/course/intro-to-svelte)

## Intro to Svelte

13/141

### Section 1

- [1.1VSCode Extensions and Settings](/course/intro-to-svelte/lesson/svelte-fundamentals-vscode-extensions-and-settings)

2

### Fundamentals

- [2.1Fundamentals - What is Svelte](/course/intro-to-svelte/lesson/fundamentals-what-is-svelte)
- [2.2Fundamentals - Why SvelteKit](/course/intro-to-svelte/lesson/fundamentals-why-sveltekit)
- [2.3Fundamentals - Benefits of SvelteKit](/course/intro-to-svelte/lesson/fundamentals-benefits-of-sveltekit)
- [2.4Fundamentals - Performance](/course/intro-to-svelte/lesson/fundamentals-performance)
- [2.5Fundamentals - File Based Routing](/course/intro-to-svelte/lesson/fundamentals-file-based-routing)
- [2.6Svelte Fundamentals - Styling in Svelte](/course/intro-to-svelte/lesson/fundamentals-styling-in-sveltekit)

3

### Svelte Basics

- [3.1Svelte Basics](/course/intro-to-svelte/lesson/svelte-basics-getting-started)
- [3.2Svelte Basics - Sugar Syntax Markup](/course/intro-to-svelte/lesson/svelte-basics-sugar-syntax-markup)
- [3.3Svelte Basics - Sugar Syntax Logic and Each Blocks](/course/intro-to-svelte/lesson/svelte-basics-sugar-syntax-logic-each-block)
- [3.4Svelte Basics - Sugar Syntax Await and Key Blocks](/course/intro-to-svelte/lesson/svelte-basics-sugar-syntax-await-and-key-blocks)
- [3.5Svelte Basics - Reactivity](/course/intro-to-svelte/lesson/svelte-basics-reactivity)
- [3.6Svelte Basics - Props▶](/course/intro-to-svelte/lesson/svelte-basics-props)
- [3.7Svelte Basics - Slots](/course/intro-to-svelte/lesson/svelte-basics-slots)

@CodingCatDev on YouTube62.5K / 100K

Subscribe for new course lessons and architecture deep dives every week.

[Subscribe for New Lessons →](https://www.youtube.com/@codingcatdev?sub_confirmation=1)