Skip to main content

<Loading />

The Loading component renders its default slot while the authentication state is being determined. It checks the current authentication state and displays a loading indicator or custom content during the initial authentication check. Once authentication is complete, it renders an optional #fallback slot or nothing by default. This makes it ideal for providing user feedback during the initial app load or authentication verification.

Usage​

You can use the Loading component to wrap any content that should be visible during authentication state checks.

Basic Usage​

Use Loading to show content while authentication is being verified.

src/App.vue
<script setup>
import { Loading } from '@thunderid/vue'
</script>

<template>
<Loading>
<div>Checking authentication...</div>
</Loading>
</template>
note

Once the authentication state is determined, nothing will be rendered unless you provide a #fallback slot.

Fallback Slot​

Show your main application content once loading is complete using the #fallback slot:

src/App.vue
<script setup>
import { Loading, SignedIn, SignedOut } from '@thunderid/vue'
import Dashboard from './components/Dashboard.vue'
import LandingPage from './components/LandingPage.vue'
</script>

<template>
<Loading>
<div>Checking authentication...</div>
<template #fallback>
<SignedIn>
<Dashboard />
</SignedIn>
<SignedOut>
<LandingPage />
</SignedOut>
</template>
</Loading>
</template>

Slots​

SlotDescription
defaultContent to render during authentication loading
fallbackContent to render once authentication is determined

Explore with AI

ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© Copyright Linux Foundation Europe.For web site terms of use, trademark policy and other project policies please see https://linuxfoundation.eu/en/policies.