From 98690453f723a98bce7b7b189f056674de21c7de Mon Sep 17 00:00:00 2001 From: Joshua Chen Date: Wed, 19 Feb 2025 12:40:29 -0500 Subject: [PATCH] More info --- .../api/web_components/using_templates_and_slots/index.md | 4 +++- files/en-us/web/html/element/slot/index.md | 5 +---- files/en-us/web/html/global_attributes/slot/index.md | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/files/en-us/web/api/web_components/using_templates_and_slots/index.md b/files/en-us/web/api/web_components/using_templates_and_slots/index.md index a9671e0d1acf174..3d463ffafe0372c 100644 --- a/files/en-us/web/api/web_components/using_templates_and_slots/index.md +++ b/files/en-us/web/api/web_components/using_templates_and_slots/index.md @@ -120,7 +120,9 @@ or And that's it for our trivial example. If you want to play with it some more, you can [find it on GitHub](https://github.com/mdn/web-components-examples/tree/main/simple-template) (see it [running live](https://mdn.github.io/web-components-examples/simple-template/) also). -A slot can be defined without a name attribute (or with `name=""`), which creates a default slot that will capture any content not explicitly assigned to a named slot. Here's an example: +The `name` attribute should be unique per shadow root: if you have two slots with the same name, all of the elements with a matching `slot` attribute will be assigned to the first slot with that name. But the `slot` attribute does not need to be unique: a `` can be filled by multiple elements that all have a matching `slot` attribute. + +The `name` and `slot` attributes both default to the empty string, so elements with no `slot` attributes are assigned to the `` with no `name` attribute (the unnamed slot, or default slot). Here's an example: ```html