Passing data from layouts to pages in SvelteKit
Components can pass data back to their slotted content via slot props In this app, we have a list of named CSS colours Typing into the input> will filter
2 ways to pass data into Svelte slots svelte pass props to slot Components can pass data back to their slotted content via slot props In this app, we have a list of named CSS colours Typing into the input> will filter svelte slot slot props from the HOC and explicity pass them into cat --> !-- Notice the event listener is on the cat, which is explicit on the one hand but also
svelte check if slot is empty Luckily, Svelte makes binding components extremely intuitive All we have to do is go into our parent component where the ShoppingCart component is being used
Regular
price
172.00 ₹ INR
Regular
price
Sale
price
172.00 ₹ INR
Unit price
/
per