Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v4] feature: close button icon for toasts #16237

simonhaenisch opened this issue Nov 6, 2018 · 2 comments


None yet
3 participants
Copy link

commented Nov 6, 2018

Feature Request

Ionic Info

"@ionic/core": "4.0.0-beta.15"

Describe the Feature Request

Add an option closeButtonIcon: string to ToastOptions that renders an icon instead of closeButtonText, or next to the closeButtonText.

Describe Preferred Solution

I mainly want to modify this part of the ion-toast template

{this.showCloseButton &&
<ion-button fill="clear" ion-activatable class="toast-button" onClick={() => this.dismiss(undefined, 'cancel')}>
{this.closeButtonText || 'Close'}

to something like this:

  {this.closeButtonIcon && (
    <ion-icon name={this.closeButtonIcon} slot={this.closeButtonText ? 'end' : 'icon-only'} />
  {this.closeButtonText || (this.closeButtonIcon ? '' : 'Close')}

Describe Alternatives


Additional Context

I'll make a PR for this, just don't have the time right now, and wanted to have a reminder for myself...


This comment has been minimized.

Copy link

commented Jan 17, 2019

@simonhaenisch Check out #17147. Do you think that will work for you?


This comment has been minimized.

Copy link

commented May 11, 2019

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators May 11, 2019

Kiku-git added a commit to Kiku-git/ionic that referenced this issue May 16, 2019

feat(toast): add header and additional custom toast buttons (ionic-te…

Adds a `header` and `buttons` property to toast. This allows for a toast header to be passed and multiple buttons including action buttons and icon only buttons which matches the Material Design spec. Adds hover states to the button to match the spec. Updates usage section to recommend the new way of passing a close button using the buttons array and `cancel` role. If a button is passed using the cancel role default the color to match the spec. Buttons will default to the `end` side but have the option of being placed on the `start` side.

Co-authored-by: Simon Hänisch <>
Co-authored-by: Brandy Carney <>

closes ionic-team#16791 closes ionic-team#16237 closes ionic-team#17611
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.