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.
The same code, once with nobody signed in and once with the sample person signed in.
Installation
- npm
- pnpm
- Yarn
- Bun
npm install @lumoauth/react
pnpm add @lumoauth/react
yarn add @lumoauth/react
bun add @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
| Prop | Type | Description |
|---|---|---|
childrenrequired | ReactNode | SignedIn shows them when a person is signed in. SignedOut shows them when nobody is. |