export htmlattributes as props where possible
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
<script lang="ts">
|
||||
import type { Snippet } from 'svelte';
|
||||
|
||||
import { portal } from '$lib/actions/portal';
|
||||
import type { ViewportPortalProps } from './types';
|
||||
|
||||
let { children }: { children?: Snippet } = $props();
|
||||
let { children, ...rest }: ViewportPortalProps = $props();
|
||||
</script>
|
||||
|
||||
<div use:portal={'viewport'}>
|
||||
<div use:portal={'viewport'} {...rest}>
|
||||
{@render children?.()}
|
||||
</div>
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export { default as ViewportPortal } from './ViewportPortal.svelte';
|
||||
export * from './types';
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { Snippet } from 'svelte';
|
||||
import type { HTMLAttributes } from 'svelte/elements';
|
||||
|
||||
export type ViewportPortalProps = {
|
||||
children?: Snippet;
|
||||
} & HTMLAttributes<HTMLDivElement>;
|
||||
Reference in New Issue
Block a user