Introduce `loading` prop for buttons
See original GitHub issueIs your feature request related to a problem? Please describe…
If a user clicks a button that triggers a long async action, there is no easy way to provide feedback.
Describe the solution you’d like
I would like to set a loading state on a button, that can be enabled/disabled by setting a ‘loading’ prop. Enabling the loading prop will automatically show a loading indicator on the button (prepend before the label?) and disable the button from further user action.
Describe alternatives you’ve considered
We can use the spinner
in combination with a button and some additional setting to get the same result, but this feels verbose.
Additional context
Perhaps other actionable elements can also receive the loading
prop.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:5 (5 by maintainers)
Top Results From Across the Web
React Loading Button Component - CoreUI
React Loading Button Component. Buttons with built-in loading indicators. Indicate the loading state of the button bridging the gap between action and feedback....
Read more >How to: Asynchronous buttons with loading state in React ...
All we have to do to make our button asynchronous is re-implement its onClick event. const Button = (props) => { ...
Read more >React Material UI Tutorial - 39 - Loading Button - YouTube
Courses - https://learn.codevolution.dev/ Support - https://www.paypal.me/Codevolution Github - https://github.com/gopinav⚡️ Checkout ...
Read more >React Suite Loading Button - GeeksforGeeks
React Suite Button Loading Props: loading: It is a boolean property of the Button component used to show a loading button. color: This...
Read more >Creating a nice loading button with React Hooks - humbledev
Tutorial showing how to create a loading button with React Hooks.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
One could simple v-if a
<b-spinner>
in a<b-button>
, and then the user would have complete control of where the loading spinner is placed, what loading spinner (or feedback) they want, etc.An alternative, when v2.7.0 is released you could wrap the
<b-button>
with the new<b-overlay>
component for an even fancier loading button.See https://bootstrap-vue.netlify.com/docs/components/overlay for a preview of 2.7.0
BootstrapVue 2.7.0 has been released, with the new
<b-overlay>
component.