Borrowed from Ghost's 'gh-spin-button' component Copyright 2013-2016 Ghost Foundation

Button that spins to show something is happening.

Show:

action

Action

Action to call when clicking the button

autoWidth

Boolean

Specifies whether or not the button should retain its width when the spinner is activated.


Default: true

buttonIcon

String

If you want a button-icon to be displayed, put any of the font-awesome icons as a string here. Must use full icon name, including the class


Default: ''

buttonText

String

If you are rendering the promise button as an inline component and not in block form, set this to whatever text you want the button to display.


Default: ''

buttonTitle

String

Title to display on button hover


Default: null

disableWhen

Boolean

Boolean property that disables the button when set to true.


Default: false

fixWidth

Boolean

If true, the button will be a fixed width and the icon will hide regardless of whether or not the spinner is activated. (Used with )


Default: false

showSpinner

Boolean private

Private instance variable holding whether or not the button is currently spinning.


Default: false

showSpinnerTimeout

Event private

Private variable that holds the timer event that manages the switch back to not spinning after a timeout period.


Default: null

spinIcon

String

Sets the icon to be shown when the promise is resolving. See here for a list of possible icons.


Default: 'fa-solid fa-rotate'

submitting

Boolean

Variable used to specify whether the button should be spinning or not.


Default: false

timeout

Number

Sets the timeout of the button. If this is set, the button will continue to spin for the time specified even after submitting is set to false. This is useful if you wish to show that something happened, even if it happens quickly.


Default: 1000

timeout

Number

Sets the progress percent of the button. Used with submitting to show a sort of progress bar. Must be a number between 0 and 100, setting to null disables it.


Default: null