Declare and pass in properties to a Svelte 3 component

InstructorTomasz Łakomy

Share this video with your friends

Send Tweet

One of the key advantages of having a component system is the ability to render the component differently based on what kind of properties (shortened to 'props' in Svelte) were passed in to the component.

In this lesson we are going to learn how to declare properties inside of a Svelte component and how to pass in data to be rendered inside of a <UserInfo /> component. We're also going to learn how to use default props which are used if a value for a property was not passed in.