From ced967368114c42e1f0a23616cbfc8d5fb62926b Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Sun, 18 Feb 2024 19:36:46 -0800 Subject: [PATCH] docs(toast-notification): add "Autoclose" example --- .../pages/components/ToastNotification.svx | 8 +++++ .../ToastNotificationTimeout.svelte | 32 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 docs/src/pages/framed/ToastNotification/ToastNotificationTimeout.svelte diff --git a/docs/src/pages/components/ToastNotification.svx b/docs/src/pages/components/ToastNotification.svx index 571b6289..d924de80 100644 --- a/docs/src/pages/components/ToastNotification.svx +++ b/docs/src/pages/components/ToastNotification.svx @@ -14,6 +14,14 @@ See also: [InlineNotification](InlineNotification) +## Autoclose + +By default, `ToastNotification` does not automatically close. + +Specify the `timeout` prop to automatically close the notification after a specified duration (in milliseconds). + + + ## Prevent default close behavior `ToastNotification` is a controlled component. Prevent the default close behavior using the `e.preventDefault()` method in the dispatched `on:close` event. diff --git a/docs/src/pages/framed/ToastNotification/ToastNotificationTimeout.svelte b/docs/src/pages/framed/ToastNotification/ToastNotificationTimeout.svelte new file mode 100644 index 00000000..547ba581 --- /dev/null +++ b/docs/src/pages/framed/ToastNotification/ToastNotificationTimeout.svelte @@ -0,0 +1,32 @@ + + + + +{#if showNotification} +
+ +
+{/if}