Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing documentation for the children prop? #1232

Open
WillsterJohnson opened this issue Mar 26, 2025 · 3 comments
Open

missing documentation for the children prop? #1232

WillsterJohnson opened this issue Mar 26, 2025 · 3 comments

Comments

@WillsterJohnson
Copy link

I can't find anywhere in the docs that directly explains the children prop, what it's for, and how to use it. Have I missed something?

I can see several places where children is used, but none of them are actually discussing the prop itself.

A section under https://svelte.dev/docs/svelte/$props which explains the children prop directly would be ideal imo.

@brunnerh
Copy link
Member

It is currently explained here.

Any content inside the component tags that is not a snippet declaration implicitly becomes part of the children snippet

@WillsterJohnson
Copy link
Author

It didn't occur to me to look in the snippets section, maybe a link to that section under $props would be a good idea? imo the children prop seems more prop related than snippet related; you don't have to write #snippet to use children but you do have to write $props

@Conduitry
Copy link
Member

You don't have to write {#snippet} but you do have to write {@render} - which turns up relevant stuff when searched for in the documentation.

Is the concern here that you didn't know how to do something in Svelte - or is the concern that you were reading someone else's Svelte components and it wasn't clear what it was for?

I don't think we necessarily want to try to make it so that everything in the reference documentation links to all of the other adjacent things that you might be interested in. The tutorial exists for this sort of high-level explanation of the big concepts in a good order - and this is all covered in the tutorial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants