CoreUI PRO Component

To use this component you must have a CoreUI PRO license. Buy the CoreUI PRO and get access to all PRO components, features, templates, and dedicated support.

React Loading Button Component

Buttons with built-in loading indicators. Indicate the loading state of the button bridging the gap between action and feedback.

Other frameworks

CoreUI components are available as native Angular, Bootstrap (Vanilla JS), and Vue components. To learn more please visit the following pages.


1const [state, setState] = useState(false)
2const [stateO, setStateO] = useState(false)
3const [stateG, setStateG] = useState(false)
4return (
5 <>
6 <CLoadingButton loading={state} onClick={() => setState(!state)}>
7 Submit
8 </CLoadingButton>
9 <CLoadingButton variant="outline" loading={stateO} onClick={() => setStateO(!stateO)}>
10 Submit
11 </CLoadingButton>
12 <CLoadingButton variant="ghost" loading={stateG} onClick={() => setStateG(!stateG)}>
13 Submit
14 </CLoadingButton>
15 </>
1<CLoadingButton timeout={2000}>Submit</CLoadingButton>
2<CLoadingButton variant="outline" timeout={2000}>Submit</CLoadingButton>
3<CLoadingButton variant="ghost" timeout={2000}>Submit</CLoadingButton>


Border (Default)#

1<CLoadingButton color="info" timeout={2000}>Submit</CLoadingButton>
2<CLoadingButton color="success" variant="outline" timeout={2000}>Submit</CLoadingButton>
3<CLoadingButton color="warning" variant="ghost" timeout={2000}>Submit</CLoadingButton>


1<CLoadingButton color="info" spinnerType="grow" timeout={2000}>Submit</CLoadingButton>
2<CLoadingButton color="success" spinnerType="grow" variant="outline" timeout={2000}>Submit</CLoadingButton>
3<CLoadingButton color="warning" spinnerType="grow" variant="ghost" timeout={2000}>Submit</CLoadingButton>



1import { CLoadingButton } from '@coreui/react-pro'
2// or
3import CLoadingButton from '@coreui/react-pro/src/components/loading-button/CLoadingButton'
activeToggle the active state for the component.boolean-
classNameA string of all className you want applied to the base component.string-
colorSets the color context of the component to one of CoreUI’s themed colors.'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string-
componentComponent used for the root node. Either a string to use a HTML element or a component.string | ComponentClass<any, any> | FunctionComponent<any>-
disabledToggle the disabled state for the component.boolean-
disabledOnLoadingMakes button disabled when loading.boolean-
hrefThe href attribute specifies the URL of the page the link goes to.string-
loadingLoading state (set to true to start animation).boolean-
roleThe role attribute describes the role of an element in programs that can make use of it, such as screen readers or magnifiers.string-
shapeSelect the shape of the component.'rounded' | 'rounded-top' | 'rounded-end' | 'rounded-bottom' | 'rounded-start' | 'rounded-circle' | 'rounded-pill' | 'rounded-0' | 'rounded-1' | 'rounded-2' | 'rounded-3' | string-
sizeSize the component small or large.'sm' | 'lg'-
spinnerTypeSets type of spinner.'border' | 'grow'border
timeoutAutomatically starts loading animation and stops after a determined amount of milliseconds.number-
typeSpecifies the type of button. Always specify the type attribute for the <button> element.
Different browsers may use different default types for the <button> element.
'button' | 'submit' | 'reset'-
variantSet the button variant to an outlined button or a ghost button.'outline' | 'ghost'-