-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Open
Description
Describe the problem
There have been multiple times where I've wanted to pass HTML to a Snippet
during a render
call.
The current way to do to this is create a whole new Snippet
, then pass it on. Which feels gross when you have 2 or more. I was wondering what the general consensus is? Do you find this an anti-pattern?
I often use Snippets when creating a component would be overkill. Such as reuse within one specific component, but I'd still like to be able to have better control over the content.
Describe the proposed solution
{#snippet row(title: string, content: Snippet)]
<div>
<h1>{title</h1>
{@render content()}
</div>
{/snippet}
{@render row("Testing", <div>an example</div>)} // Do it on the fly`
or
{#snippet row(title: string)
<div>
<h1>{title</h1>
{@render children}
</div>
{/snippet}
{#render row('Second Test')} // Use it like you would component's children
<div>
Hello!
</div>
{/render}
Importance
nice to have
Metadata
Metadata
Assignees
Labels
No labels