feat(fab-button): add closeIcon property (#19626)

This commit is contained in:
Stefanos Anagnostou
2020-06-08 23:46:03 +03:00
committed by GitHub
parent f34d3752e3
commit 698e526b9f
5 changed files with 24 additions and 7 deletions

View File

@ -93,10 +93,17 @@ export class FabButton implements ComponentInterface, AnchorInterface, ButtonInt
@Prop() type: 'submit' | 'reset' | 'button' = 'button';
/**
* The size of the button. Set this to `small` in order to have a mini fab.
* The size of the button. Set this to `small` in order to have a mini fab button.
*/
@Prop() size?: 'small';
/**
* The icon name to use for the close icon. This will appear when the fab button
* is pressed. Only applies if it is the main button inside of a fab containing a
* fab list.
*/
@Prop() closeIcon = 'close';
/**
* Emitted when the button has focus.
*/
@ -156,7 +163,7 @@ export class FabButton implements ComponentInterface, AnchorInterface, ButtonInt
onClick={(ev: Event) => openURL(href, ev, this.routerDirection, this.routerAnimation)}
>
<span class="close-icon">
<ion-icon name="close" lazy={false}></ion-icon>
<ion-icon icon={this.closeIcon} lazy={false}></ion-icon>
</span>
<span class="button-inner">
<slot></slot>