Slot props • Svelte Examples
Slot props • Svelte Examples
Regular
price
189.00 ₹ INR
Regular
price
Sale
price
189.00 ₹ INR
Unit price
/
per
svelte pass props to slot Dan svelte slot props
View full details
We can use slot props to pass data from the child to parent using the let: directive of slots This helps us set up separation of concerns
svelte · !-- · Pass-through props · Allow you to receive props from the component interface and pass them to a particular element · Within the component Not all pass data to both components
alicewong av script> ; import Child from ' ' ; Child propValue=Pass this to the child! > 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