Send snippets (that are not children) to +layout.svelte
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
I am creating a base page layout, that has different "slots", say a sidebar, a "main" content container, maybe a righthand sidebar ...
Content in these elements change frequently, hence the need to make sure that the layout is uniform for all of them.
one other reason that might be not relevant to everywhere, is that I need to initialize a
canvascomponent in the layout and send somemanagerand somestoredownstream using the context API.
Describe the proposed solution
the ability for the layout page to receive multiple snippets:
<script>
let {snippetA, snippetB} = $props();
</script>
<div>
{@render snippetA()}
</div>
<div>
the stuff I want to do
</div>
<div>
{@render snippetB()}
</div>
Alternatives considered
Currently the 2 things possible are:
- reverting back to using named slots
- only using
children()snippet with layout.
Importance
would make my life easier
Additional Information
discord :
https://discord.com/channels/457912077277855764/1288862792887308410
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the +layout.svelte entry point and the issue's proposed $props()/@render snippet example. Determine how non-child snippets would be passed to layouts alongside children(); done means a layout can receive and render multiple named snippets while preserving the existing alternatives.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100