Logo

Sierra-95/svelte-scaffold

Alert Modal

Alert Modal

Place this anywhere in your app

svelte
Loading...

Static Mode

svelte
Loading...

Dynamic Mode

Used to render custom UI such as inputs, forms, or any arbitrary markup inside the modal.

svelte
Loading...

Use modalStore.update() for optional properties to keep defaults

NameTypeDefaultDescription
openbooleanfalseDecides if the modal is open
titlestring''(Required)
contentstring''(Optional)
confirmTextstring'Confirm'(Optional)
cancelTextstring'Cancel'(Optional)
onConfirmfunctionvoidCallback function when the confirm button is clicked.
onCancelfunctionvoidCallback function when the cancel button is clicked. (optional).
render() => SnippetnullFunction that returns dynamic modal content. Used to render custom UI such as inputs, forms, or any arbitrary markup inside the modal. (Optional)