How to pass a Svelte component to another Svelte component
Using allows you to pass Svelte components to another Svelte component dynamically, and not adding so much markup on a single Svelte component.
How to pass a Svelte component to another Svelte component launched on February 8, 2020 with 6 votes, #1,040 of 3,162 launches that month and more than 50% of that year's launches. The site was still online in September 2026, 6 years on.
What it does
How in the world do you pass a Svelte component down to another Svelte component ? But that method has its limitations. The <slot> directive cannot be dynamic. For example, what if you have an array of Svelte components? Since the <slot> directive cannot be dynamic, how do you handle this type of scenario? To pass Svelte components dynamically down to a child component you have to use Svelte’s <svelte:component> directive. If the property this has a component attach to it than it will render the given Svelte component. But if the value is falsy ( false , undefined , null ) than it will not render. In a recent article, I created a very simple Svelte Tab component. You can find the…from linguinecode.com
Does a similar job
all alternatives →
Turn Markdown into React/Svelte/Vue UI at runtime, zero build step2025 · markdown-ui.com · ▲202Markdown UI - Interactive widgets in Markdown
Svelte NodeGUI, a lightweight Electron alternative with native UI2021 · github.com · ▲624Build performant, native and cross-platform desktop applications with native Svelte + powerful CSS-like styling.🚀 - nodegui/svelte-nodegui

Svelte Flow – a library for creating node-based UIs2023 · svelteflow.dev · ▲81A customizable Svelte component for building node-based editors and interactive diagrams
A cool Drag-and-Drop implementation for Svelte2021 · github.com · ▲141An action based drag and drop container for Svelte - isaacHagoel/svelte-dnd-action
Flowbite Svelte2023 · flowbite-svelte.com · ▲180Open-source UI components for Svelte and Tailwind CSS
More life & fun this month
the category →
A free city-building game in your browser. You are the mayor. You know what the city needs. Now get it past the zoning board, the neighbors, the appeals court and the next election.
Life & fun · 4d ago · permit.petercai.com
- IV
Life & fun · 16d ago · tanzaniaeducationproject.org

Turn a phone, tablet or TV into a sign. Type a message and it fills the screen: welcome signs, timers, Wi-Fi passwords and more. No app, no account, free.
Life & fun · 17d ago · bigwords.page

Play a free virtual guitar online with your keyboard or by touch. Slow songs down and see every chord, string and strum. Acoustic, classic, electric and bass.
Life & fun · 11d ago · guitoro.com

Carrier settings from iPhone, Pixel and Galaxy firmware, decoded and compared: APNs, VoLTE, 5G and Wi-Fi Calling per carrier, and what each build changed.
Life & fun · 15d ago · carrierexplode.com

Source: Show HN post ↗
Launched alongside, February 2020
the whole month →

- SC
Dev tools · 2020 · grep.app


- PH
Profit Hunt | Discover ideas that make money
Commerce · 2020 · profithunt.co