mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 20:33:02 +00:00
feat(toast-notification): make title/subtitle/caption slottable
This commit is contained in:
parent
e59e1a9348
commit
e225c545ab
5 changed files with 47 additions and 12 deletions
|
@ -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",
|
||||
|
|
|
@ -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()}" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue