feat(toast-notification): make title/subtitle/caption slottable

This commit is contained in:
metonym 2021-11-12 16:15:56 -08:00
commit e225c545ab
5 changed files with 47 additions and 12 deletions

View file

@ -12279,7 +12279,27 @@
"reactive": false
}
],
"slots": [{ "name": "__default__", "default": true, "slot_props": "{}" }],
"slots": [
{ "name": "__default__", "default": true, "slot_props": "{}" },
{
"name": "caption",
"default": false,
"fallback": "{caption}",
"slot_props": "{}"
},
{
"name": "subtitle",
"default": false,
"fallback": "{subtitle}",
"slot_props": "{}"
},
{
"name": "title",
"default": false,
"fallback": "{title}",
"slot_props": "{}"
}
],
"events": [
{
"type": "dispatched",

View file

@ -11,6 +11,14 @@ source: Notification/ToastNotification.svelte
<ToastNotification title="Error" subtitle="An internal server error occurred." caption="{new Date().toLocaleString()}" />
### Slottable title, subtitle, caption
<ToastNotification>
<strong slot="title">Error: </strong>
<strong slot="subtitle">An internal server error occurred.</strong>
<strong slot="caption">{new Date().toLocaleString()}</strong>
</ToastNotification>
### Hidden close button
<ToastNotification hideCloseButton kind="warning" title="Scheduled maintenance" subtitle="Maintenance will last 2-4 hours." caption="{new Date().toLocaleString()}" />