We may earn an affiliate commission when you visit our partners.
Course image
Georg Schessler and Daniel Szabo

This course provides an overview of the fundamentals of Svelte, a fast and simple frontend framework which is easy to learn and to use.

It will start with introducing the basic concepts with quick examples provided - what does it mean that Svelte is component-based? What are those components built of? How to connect them to use one component inside of another one? How to transfer data between them? How to add logic / asynchronicity / reactivity to them?

Things like that.

Read more

This course provides an overview of the fundamentals of Svelte, a fast and simple frontend framework which is easy to learn and to use.

It will start with introducing the basic concepts with quick examples provided - what does it mean that Svelte is component-based? What are those components built of? How to connect them to use one component inside of another one? How to transfer data between them? How to add logic / asynchronicity / reactivity to them?

Things like that.

The second building block will be about getting an app idea, making a plan about how it should look like, what Svelte components need to be used in order to implement it, what the functionalities of those components have to be, and what should be the relation between them.  And that app will be then built from scratch, step by step, using the basic Svelte concepts introduced previously.

The third part will go into more Svelte details, explaining the component lifecycle and the Svelte special elements. Finally SvelteKit, the popular Svelte framework will be introduced as well - what can it be used for? How does it make routing more efficient? What happens if I call the load method in a script tag with its context set to "module"? Is it a good idea to turn off server-side rendering?

Do these questions sound exciting to you? Then let's give this course a try.

Enroll now

Here's a deal for you

We found an offer that may be relevant to this course.
Save money when you learn. All coupon codes, vouchers, and discounts are applied automatically unless otherwise noted.

What's inside

Learning objectives

  • Basic and advanced svelte features
  • Building a svelte project
  • Reactive web applications with svelte
  • Using stores in svelte
  • Svelte special elements
  • Fetching data from an api
  • Sveltekit basics

Syllabus

Introduction

What to expect from this course

The first impressions about Svelte

Warming up with classic HTML/CSS/JS

Read more
Svelte Basics

How to create, build and import a new component.

The first exercise! Create your own Svelte component and discover the current year!

The first solution!

Passing down data from the parent component to the child component.

In Svelte you can use #if statements and #each loops in the HTML code. But how??

Okay now try it yourself.

Let's iterate through those messages!

Have you ever wanted to wait until a promise is resolved?

Calling a function when a button is clicked.

What is event dispatching and how to use it?

Now can you manage to dipatch an event on your own?

This is a way add messages by dispatching an event.

More Svelte Features

Reactivity is a part where Svelte really shines. All it takes is a '$' and a ':'

Using two-way data binding between an input element and a local variable.

Explaining the concept of the Store - variables accessible from components all across the app.

Svelte Store DIY

Step by step walkthrough to read to and write from a writable store.

Creating variables that are readable by the descendant components.

Building a Svelte Project

The project to be implemented in the upcoming videos.

If you want to get the final version, here it is.

NOTE: for syntax highlighting and better autocomplete in VS Code, it's highly recommended to download the Svelte extension ("Svelte for VS Code")

How the app and the component structure should look like.

Adding a store for the Settings values.

The Fact component's job is to display whatever sentence it receives from the Feed component.

An attempt to make the UI just a little bit less ugly.

The API can be found here: https://catfact.ninja/

Explaining some specialities of the setInterval() / clearInterval() functions.

Providing the option to pause and restart the feed, by adding a button to the Settings component.

Component Lifecycle

A few words about onMount(), onDestroy(), beforeUpdate() and afterUpdate() functions.

Tick - a function that returns a promise that resolves as soon as any pending state changes have been applied to the DOM.

Let's assume that the Child component includes both the four lifecycle methods as implemented in the first video and also the implementation of the tick() function as shown in the second video...


Special Elements

What if you want to be up-to-date of your windows width?

Keep track of the details happening around the body!

Is there something you want to add or modify in the HTML head? No problem.

You feel that sometimes this component should be used, sometimes that one? Consider using the <svelte:component> tag!

Be aware of the recursion whenever you use <svelte:self>!

You have the chance to set some specific options with this element.

Slot is not a special element but a quite common one in Svelte.

There is a difference between rendering a div and rendering the content of the div.

Intro to SvelteKit

Introducing the most popular Svelte framework (as of 2021 December...)

SvelteKit optimizes routing - matching the URL with the components to render.

Two special files in SvelteKit that start with double underscore. What to use them for?

This function takes the request object and returns a session object that is accessible on the client.

A component that defines a page or a layout can export a load function that runs before the component is created.

Is there a file in your routes folder you don't want to reach directly by a URL? Use a file with starting with a single underscore!

How to use variable values as part of the URL?

What's the difference between switching on and off the Server-side Rendering?

Another Svelte Framework, specialized on client-side rounting

The number of Svelte frameworks is increasing.

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Explores the fundamentals of Svelte
Helps learners build their own Svelte project
Covers basic and advanced Svelte features
Helps learners create reactive web applications with Svelte
Teaches learners how to use stores in Svelte
Provides instruction on fetching data from an API
Offers an introduction to SvelteKit

Save this course

Save Introduction to Svelte (and SvelteKit) to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Introduction to Svelte (and SvelteKit) with these activities:
Refresh your understanding of JavaScript fundamentals
Ensure a strong foundation by reviewing JavaScript fundamentals, which are essential for understanding Svelte.
Browse courses on JavaScript Fundamentals
Show steps
  • Review variables, data types, operators, and control flow in JavaScript.
  • Practice writing simple JavaScript functions and objects.
  • Experiment with DOM manipulation using JavaScript.
Organize and review your Svelte learning materials
Enhance your learning by organizing and reviewing your Svelte notes, assignments, and resources.
Show steps
  • Gather all your Svelte-related materials, including lecture notes, assignments, and online resources.
  • Create a dedicated space for your Svelte learning materials.
  • Review your materials regularly to reinforce your understanding.
Practice with basic Svelte components
Work through the basic examples and assignments in the online course to solidify your understanding of the core Svelte components.
Show steps
  • Create a new Svelte project.
  • Add a simple component to your project.
  • Use props to pass data between components.
  • Create a component that can be reused in multiple places.
Five other activities
Expand to see all activities and additional details
Show all eight activities
Follow along with Svelte tutorial videos
To complement the course materials, find and watch video tutorials on Svelte to reinforce your understanding of concepts.
Show steps
  • Search for Svelte tutorials on platforms like YouTube or Udemy.
  • Choose a tutorial that covers a topic you're interested in.
  • Follow along with the tutorial step-by-step.
Build a simple Svelte application
To demonstrate your mastery of Svelte, create a simple application that uses the concepts you've learned in the course.
Show steps
  • Plan the structure and functionality of your application.
  • Create the necessary Svelte components.
  • Implement the application's logic and functionality.
  • Test and debug your application.
  • Deploy your application to a hosting platform.
Connect with experienced Svelte developers
Seek out experienced Svelte developers in online communities or at meetups to gain insights and guidance for your learning journey.
Show steps
  • Join Svelte-related online forums or communities.
  • Attend local Svelte meetups or conferences.
  • Reach out to Svelte developers on platforms like LinkedIn.
Contribute to an open-source Svelte project
To deepen your understanding of Svelte and contribute to the community, consider contributing to an open-source Svelte project.
Show steps
  • Find an open-source Svelte project that interests you.
  • Review the project's documentation and contribution guidelines.
  • Identify a specific area or feature you can contribute to.
  • Create a pull request with your proposed changes.
  • Collaborate with the project maintainers to refine and merge your contribution.
Create a Svelte study guide
To improve your understanding and retention of the course material, compile a study guide that summarizes the key concepts and examples covered in the course.
Show steps
  • Review the course syllabus and lecture notes.
  • Summarize the main concepts in each section.
  • Include examples and practice exercises.
  • Review and update the study guide regularly.

Career center

Learners who complete Introduction to Svelte (and SvelteKit) will develop knowledge and skills that may be useful to these careers:

Reading list

We haven't picked any books for this reading list yet.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Here are nine courses similar to Introduction to Svelte (and SvelteKit).
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2024 OpenCourser