Skip to main content

buttons

Description

Optional. An array of buttons for a modal box

Usage

buttons?: string[];

Default value

["cancel", "ok"]

Example

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

let custom1;
function hideAll() {
custom1 = false;
}
</script>

{#if custom1}
<Portal>
<Modal title="Custom Prompt" onconfirm={hideAll} buttons={["ok"]}>
<Text select={true} focus={true} value="Some" />
</Modal>
</Portal>
{/if}

Related article: Providing the buttons functionality

Related sample: Messages