slot() — svelte Function Reference
Architecture documentation for the slot() function in slot.js from the svelte codebase.
Entity Profile
Dependency Diagram
graph TD 9ae4e86c_a885_2eeb_217f_b5ceb41f71e7["slot()"] 2537b828_1113_c3e6_b7bf_1ee136abf18f["slot.js"] 9ae4e86c_a885_2eeb_217f_b5ceb41f71e7 -->|defined in| 2537b828_1113_c3e6_b7bf_1ee136abf18f b31601aa_35ce_7827_5394_99fb97fa27d2["hydrate_next()"] 9ae4e86c_a885_2eeb_217f_b5ceb41f71e7 -->|calls| b31601aa_35ce_7827_5394_99fb97fa27d2 style 9ae4e86c_a885_2eeb_217f_b5ceb41f71e7 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/svelte/src/internal/client/dom/blocks/slot.js lines 10–30
export function slot(anchor, $$props, name, slot_props, fallback_fn) {
if (hydrating) {
hydrate_next();
}
var slot_fn = $$props.$$slots?.[name];
// Interop: Can use snippets to fill slots
var is_interop = false;
if (slot_fn === true) {
slot_fn = $$props[name === 'default' ? 'children' : name];
is_interop = true;
}
if (slot_fn === undefined) {
if (fallback_fn !== null) {
fallback_fn(anchor);
}
} else {
slot_fn(anchor, is_interop ? () => slot_props : slot_props);
}
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does slot() do?
slot() is a function in the svelte codebase, defined in packages/svelte/src/internal/client/dom/blocks/slot.js.
Where is slot() defined?
slot() is defined in packages/svelte/src/internal/client/dom/blocks/slot.js at line 10.
What does slot() call?
slot() calls 1 function(s): hydrate_next.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free