Skip to content

Loading

The Loading component allows you to display a loading state for use on a global state or a specific element.

Examples

Base

The loading state is displayed across the entire page if the full-page prop is added. Otherwise, the overlay will be aligned to the next wrapper element with style="position: relative".

Slot

Override the loading icon by passing a default slot.

Programmatically

This component provides a programmatic interface that can be accessed by the useOruga() composable. The composable can be used from outside the Vue instance. For example, it can be used in Pinia or Vue Router with this syntax:

    import { useOruga } from "@oruga-ui/oruga-next";
    const oruga = useOruga();
    oruga.loading.open({...});
        

Loading Component

A simple loading overlay.

html
<o-loading></o-loading>

Props

Prop nameDescriptionTypeValuesDefault
activeWhether loading is active or not, use v-model:active to make it two-way bindingboolean-false
animationCustom animation (transition name)string-
From config:
loading: {
  animation: "fade"
}
cancelable
deprecated - use closeOnOutside and closeOnEscape
Is Loading cancelable by pressing escape or clicking outside
boolean-
clipScrollSet true to remove the body scrollbar when fullPage.
When false, a non-scrollable scrollbar will be kept to avoid moving the background,
but will set the body to a fixed position, which may break some layouts.
boolean-
From config:
loading: {
  clipScroll: false
}
closeOnEscapeClose when pressing escape keyboolean-false
closeOnOutsideClose when clicked outside of the panelboolean-false
fullPageLoader will overlay the full pageboolean-true
iconIcon name to show, unnecessary when default slot is usedstring-
From config:
loading: {
  icon: "loading"
}
iconPackIcon pack to use for the close iconstringmdi, fa, fas and any other custom icon pack
From config:
loading: {
  iconPack: undefined
}
iconSizeIcon sizestringsmall, medium, large
From config:
loading: {
  iconSize: "medium"
}
iconSpinEnable spin effect on iconboolean-
From config:
loading: {
  iconSpin: true
}
labelShow a label beside the icon, unnecessary when default slot is usedstring-
overrideOverride existing theme classes completelyboolean-

Events

Event namePropertiesDescription
update:activevalue boolean - updated active propactive prop two-way binding
update:fullPagevalue boolean - updated fullPage propfullPage prop two-way binding
closeevent Event - native eventon active state changes to false

Slots

NameDescriptionBindings
defaultOverride icon and labelclose close - function to close the component

Class Inspector

Classes applied to the element:
Want to know how does the Class Inspector work?
Class propDescriptionPropsSuffixes
rootClass
Class of the root element.
fullPageClass
Class for the root element when fullpage.
fullPage
overlayClass
Class of the overlay element.
iconClass
Class for the icon element.
labelClass
Class for the label element.
scrollClipClass
Class of the body when fullpage and scroll is clipped.
clipScroll
scrollKeepClass
Class of the body when fullpage and scroll is keeped.
clipScroll

Sass Variables

Current theme ➜ Oruga

SASS VariableDefault
$loading-spacerh.useVar("control-spacer")
$loading-colorh.useVar("font-color")
$loading-font-sizeh.useVar("font-size")
$loading-font-weighth.useVar("font-weight")
$loading-zindexmap.get(vars.$zindex, "sticky")
$loading-fullpage-zindexmap.get(vars.$zindex, "fixed")
$loading-overlay-background-colorrgba(255, 255, 255, 0.5)

See ➜ 📄 SCSS file

Current theme ➜ Bulma

SASS VariableDefault
$loading-background-colorrgba(255, 255, 255, 0.5)
$loading-icon-size3em
$loading-icon-size-full-page5em
$loading-z29

See ➜ 📄 SCSS file

Current theme ➜ Bootstrap

SASS VariableDefault
$loading-zindex$zindex-sticky
$loading-zindex-fullpage$zindex-fixed
$loading-overlayrgba(255, 255, 255, 0.5)

See ➜ 📄 SCSS file

Released under the MIT License.