Skip to main content

theme

Description

Optional. Applies the specified theme for a component moved via the portal

Usage

theme?: "willow" | "willow-dark";

Example

<script>
import { Modal, TextArea, Portal, Button } from "@svar-ui/svelte-core";

let custom, box;
function hideAll() {
custom = false;
}
</script>

<Button onclick={() => (custom = !custom)}>Show Dialog</Button>

{#if custom}
<Portal theme={"willow-dark"}>
<Modal>
Some text here
<TextArea placeholder="Some text" />
<div>{#snippet footer()}<Button onclick={hideAll}>Yes</Button>
<Button onclick={hideAll}>No</Button>
<Button onclick={hideAll}>Maybe</Button>{/snippet}</div>
</Modal>
</Portal>
{/if}

Related article: Setting the theme for a moved component