Skip to content

Commit 8bdb27a

Browse files
committed
feat(toast): add wrapper and content parts
1 parent 2ee6d8c commit 8bdb27a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

core/api.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,9 +2016,11 @@ ion-toast,css-prop,--width,md
20162016
ion-toast,part,button
20172017
ion-toast,part,button cancel
20182018
ion-toast,part,container
2019+
ion-toast,part,content
20192020
ion-toast,part,header
20202021
ion-toast,part,icon
20212022
ion-toast,part,message
2023+
ion-toast,part,wrapper
20222024

20232025
ion-toggle,shadow
20242026
ion-toggle,prop,alignment,"center" | "start" | undefined,undefined,false,false

core/src/components/toast/toast.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ import type {
4949
*
5050
* @part button - Any button element that is displayed inside of the toast.
5151
* @part button cancel - Any button element with role "cancel" that is displayed inside of the toast.
52-
* @part container - The element that wraps all child elements.
52+
* @part wrapper - The outer wrapper for the toast overlay.
53+
* @part container - Groups the icon, content, and buttons.
54+
* @part content - The live region that contains the header and message.
5355
* @part header - The header text of the toast.
5456
* @part message - The body text of the toast.
5557
* @part icon - The icon that appears next to the toast content.
@@ -727,7 +729,7 @@ export class Toast implements ComponentInterface, OverlayInterface {
727729
})}
728730
onIonToastWillDismiss={this.dispatchCancelHandler}
729731
>
730-
<div class={wrapperClass}>
732+
<div class={wrapperClass} part="wrapper">
731733
<div class="toast-container" part="container">
732734
{this.renderButtons(startButtons, 'start')}
733735

0 commit comments

Comments
 (0)