Skip to main content

theme

Description

applies the specified theme for a component moved via the portal

Type

string

Values

"willow" | "willow-dark"

Example

<script>
import { Modal, TextArea, Portal, Button } from "wx-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