NSS Docs
DiscordStoreHomepage
nss_libs
nss_libs
  • README
  • Changelog
  • UI components
    • NssUiApi basics
    • NssAudio
    • NssButton
    • NssClient
    • NssConfirm
    • NssHelper
    • NssLoadingIndicator
    • NssModal
    • NssPadLock
    • NssResponsive
    • NssSimpleTextEditor
    • NssSvgReplacer
    • NssTextBox
    • NssTip
  • Client/server modules
    • AttachProp
    • Blip
    • Character
      • Client Character
      • Server Character
    • Chunk
    • ClientEvent
    • ConfigValidator
    • Database
    • DatabaseUpdater
    • DependencyAutoRestart
    • Discord
    • EntityInRange
    • Helper
      • Client Helper
      • Server Helper
      • Shared Helper
    • Inventory
    • Keyboard
    • Notify
    • Npc
    • ParticleFxPlayer
    • PointInRange
    • Prompts
    • ServerEvent
    • VersionCheck
Powered by GitBook
On this page
  • How to use
  • ES6 module import
  • Creating loading indicator
  • Methods

Was this helpful?

  1. UI components

NssLoadingIndicator

PreviousNssHelperNextNssModal

Last updated 1 year ago

Was this helpful?

This component provide a simple audio player to play sound fx.

How to use

ES6 module import

For NssUiApi usage, please see the of the nss_libs/ui folder.

Alternative example of direct ES6 module import:

import {NssLoadingIndicator} from "nui://nss_libs/ui/NssLoadingIndicator/NssLoadingIndicator.js";

Creating loading indicator

import {NssLoadingIndicator} from "nui://nss_libs/ui/NssLoadingIndicator/NssLoadingIndicator.js";

const target_el = document.body;

/**
 * @type {NssLoadingIndicator}
 */
const loading_indicator = new NssLoadingIndicator(target_el);

loading_indicator.show();

window.setTimeout(() => {
    loading_indicator.hide();
}, 5000);

Hint: If you use overlapping loading indicators, then create a new instance for each loading indicator.

Methods

  • show() Returns a promise which is resolved when the loading indicator is fully shown.

  • hide() Returns a promise which is resolved when the loading indicator is fully hidden (and destroyed).

README.md