# ion-loading-controller Loading controllers programmatically control the loading component. Loadings can be created and dismissed from the loading controller. View the [Loading](../loading) documentation for a full list of options to pass upon creation. ## Usage ### Javascript ```javascript async function presentLoading() { const loadingController = document.querySelector('ion-loading-controller'); await loadingController.componentOnReady(); const loadingElement = await loadingController.create({ message: 'Please wait...', spinner: 'crescent', duration: 2000 }); return await loadingElement.present(); } ``` ## Methods ### `create(options?: LoadingOptions | undefined) => Promise` Create a loading overlay with loading options. #### Returns Type: `Promise` ### `dismiss(data?: any, role?: string | undefined, id?: string | undefined) => Promise` Dismiss the open loading overlay. #### Returns Type: `Promise` ### `getTop() => Promise` Get the most recently opened loading overlay. #### Returns Type: `Promise` ---------------------------------------------- *Built with [StencilJS](https://stenciljs.com/)*