UNPKG

@grail-ui/svelte

Version:

[![NPM](https://img.shields.io/npm/v/@grail-ui/svelte)](https://www.npmjs.com/package/@grail-ui/svelte) [![minified](https://img.shields.io/bundlephobia/min/@grail-ui/svelte)](https://bundlephobia.com/package/@grail-ui/svelte) [![minified + zipped](https:

19 lines (18 loc) 521 B
import type { Action } from 'svelte/action'; import type { Writable } from 'svelte/store'; export type PortalConfig = { /** * DOM element or CSS selector to be appended to. */ target?: string | HTMLElement; }; export type PortalReturn = { /** * Action on the element that need to be "portalled". */ usePortal: Action<HTMLElement, PortalConfig>; /** * Controlled DOM element or CSS selector to be appended to. */ target: Writable<string | HTMLElement | undefined>; };