Skip to content
S

svelte-portal

Component for rendering outside the DOM of parent component

by romkorOpen source

#1294in UI Libraries
0In stores

Description

svelte-portal is a Svelte component for rendering content outside the DOM position of its parent. The Portal component moves its content to…

Highlights

  • Render content outside its parent in the DOM
  • Target any element or CSS selector
  • Portal action for elements directly
  • Works with server-side rendering

Ratings & Reviews

No ratings yet

Be the first to rate svelte-portal.

People also visit

R

@rgossiaux/svelte-headlessui

A complete, full-featured, unofficial Svelte port of Headless UI, an unstyled

UI Libraries
Launch
P

portal-vue

A Vue Plugin to render your component's template anywhere in the DOM

UI Libraries
Launch
S

Svelte (shadcn-svelte)

Svelte port of shadcn/ui

UI Libraries
Launch
F

flowbite-svelte-icons

Flowbite icon components for Svelte 5 Runes

UI Libraries
Launch
S

SvelteUI

all inclusive Svelte library - Components, Actions, Utilities, Animations

UI Libraries
Launch
S

svelte-sonner

An opinionated toast component for Svelte

UI Libraries
Launch

svelte-portal FAQ

What is svelte-portal?

A Svelte component that renders its content outside its parent's place in the DOM.

Where does the content go?

To the target you give it, such as an element or a CSS selector like #modals. If you give no target, it goes to document.body.

Can I use it without a component?

Yes. A portal action applies the same behavior to a DOM element directly.

Does it work with TypeScript?

Yes. Import the component from svelte-portal/src/Portal.svelte to get typing support.

What are the best svelte-portal alternatives?

Popular alternatives to svelte-portal include @rgossiaux/svelte-headlessui, portal-vue and Svelte (shadcn-svelte). See all svelte-portal alternatives

Developer Stuff

Badges