Skip to main content

Signed in and signed out

Two wrappers that show their children by session state. Use them for a header that changes when a person signs in.

ComponentReadyView source
Works with
ReactNext.js

The same code, once with nobody signed in and once with the sample person signed in.

Signed out
Signed in

Installation​

npm install @lumoauth/react

Usage​

import { SignedIn, SignedOut, SignInButton, UserButton } from '@lumoauth/react';

<SignedIn>
<UserButton />
</SignedIn>
<SignedOut>
<SignInButton className="btn" />
</SignedOut>

Both render nothing while the session loads, so the header does not show the wrong state for a moment.

Props​

PropTypeDescription
childrenrequiredReactNodeSignedIn shows them when a person is signed in. SignedOut shows them when nobody is.