Перейти к содержимому

08 - Props and Snippets In Svelte 5

Code Hub

0:00 / 0:00

08 - Props and Snippets In Svelte 5

4 396 просмотров · 1 год назад
Code Hub
20,6 тыс. подписчиков
4 396 просмотров · 1 год назад
Welcome to this comprehensive guide on Svelte 5’s Props and Snippets! In this video, you’ll learn how to build dynamic, reusable components using Svelte 5’s latest features. Whether you’re new to Svelte or transitioning from Svelte 4, this tutorial will help you replace outdated patterns like export and slots with modern, type-safe techniques. ------------------------------------------------------------------------------------- What You’ll Learn: 1. Props: Declare type-safe props using the $props rune and pass data from parent to child components. 2. Snippets: Replace Svelte 4’s slots with reusable, parameterized markup blocks. 3. On-Page Snippets: Define and render snippets within the same component using {#snippet} and {@render}. 4. Snippets Without Parameters: Pass static markup to child components. 5. Snippets with Default Parameters: Define parameters in the child and use default values without parent input. 6. Parent-Controlled Parameters: Override child-provided parameters with custom data from the parent. ------------------------------------------------------------------------------------- Key Features Covered: • Type Safety: Enforce prop types with TypeScript. • Child-to-Parent Data Flow: Pass parameters from child to snippet. • Flexible Markup: Reuse templates across components without duplication. ------------------------------------------------------------------------------------- Chapters: - 00:00 Introduction 00:22 Props 03:04 Snippets Introduction 03:56 On-Page Snippets & Render Tag (Basic Snippets) 04:37 Pass Parameters To Snippets 05:19 Passing Snippets to Components (No Parameters) 06:57 Snippets with Default Parameters (Child-to-Parent Data) 08:28 Overriding Parameters Of Snippets from the Parent (Parent-to-Child Data) ------------------------------------------------------------------------------------- Related Videos: 1. Custom Role Based Authentication In Asp.net Core MVC Application - Complete Tutorial:    • Create Custom Role Based Authentication In...   2. Create Custom Login, Registration, Email Verify And Forgot Password Pages In Asp.Net Core MVC App:    • Create Custom Login, Registration, Email V...   3. Create Role Based User Management API Using Dynamic Policies In Asp.Net Core Web API:    • Create User Management (Role Based) API Wi...   4. Create Role Based User Management App In Flutter With Asp.Net Core Web API as Backend From Scratch:    • Create User Management (Role Based) Flutte...   5. Create Wallpaper App In Flutter From Scratch Using Pexels API [Complete Tutorial]:    • Create Wallpaper App In Flutter From Scrat...   6. Create Camera App From Scratch In Flutter [with Flash, Camera Switching, Multiple Images Functions]:    • Create Camera App From Scratch In Flutter ...   7. Connect Flutter With Asp.Net Core Web API To Run On Emulator & Real Device:    • Connect Flutter With Asp.Net Core Web API ...   ------------------------------------------------------------------------------------- 📢 Stay Connected: 💖 Like this video if you found it helpful! 📣 Share your thoughts or questions in the comments below! 🚀 Share this video with your friends. ------------------------------------------------------------------------------------- Join WhatsApp Channel: https://whatsapp.com/channel/0029VaE0... Facebook Page Link:   / free_trained   Facebook Group Link:   / 1746009532359857   Please Subscribe Our YouTube Channel For More interesting Videos And Don't Forget To Share Our Channel With Your Friends. Note: *Please Turn Off Any Ad Blocker Software or add-on to support us. #html #css #javascript #sveltejs #svelte #sveltekit #framework #react #nextjs #angular #vuejs #programming #webdesign #webdevelopment #webdesigner #webdeveloper #learn #components #props #snippet #parameter #render