Skip to content

External Named Layout - from packageΒ #4518

@lukaszpolowczyk

Description

@lukaszpolowczyk

Describe the problem

The new [email protected] syntax looks cool.

I have a thought to expand or refute:
Support for a layout, loaded externally, from a package.

Describe the proposed solution

You install the npm i packagename package that contains the layout file.
You use this layout via the package name, for example: [email protected].
That's it. :)

You could also add a built-in, external layout in SvelteKit, e.g. to reset __layout-reset.svelte:
Then use for reset [email protected], so you won't need to create an empty __layout-root.svelte, containing the <slot/> itself (as recommended in the SvelteKit documentation).

Alternatives considered

  1. adder containing the layout.

  2. wrapper in __layout.svelte with imported component:

<script>.
Import packagename from "packagename";
</script>
<Packagename><slot/></Packagename>

...Such a thing doesn't work, because in Packagename you can't, for example, provide a load function.

Importance

would make my life easier

Additional Information

Such a thing would be part of a broader thinking about external modules, as related - #3723

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions