Skip to main content

Buttons

Three buttons with no style of their own. Each starts one action, and takes your class name or wraps your own element.

ComponentReadyView source
Works with
ReactNext.js

The SDK adds no style. The first two buttons here use the button classes of this site, and the third wraps a link.

Installation​

npm install @lumoauth/react

Usage​

There are two ways to use each button.

With a class name. The component renders a <button> with a default label ("Sign in", "Sign up", "Sign out") and your class.

import { SignInButton } from '@lumoauth/react';
import { buttonVariants } from '@/components/ui/button';

<SignInButton className={buttonVariants({ variant: 'outline' })} />

With children. The component wraps your element and adds the action to it. Use this for your own label or icon. className is not applied in this form: style the child.

import { SignOutButton } from '@lumoauth/react';

<SignOutButton afterSignOutUrl="/goodbye">
<span className="menu-item">Sign out</span>
</SignOutButton>

What each button does​

ButtonAction
SignInButtonGoes to the hosted sign-in page of your organization. (In password mode, which LumoAuth does not support, it goes to signInUrl.)
SignUpButtonGoes to signUpUrl, your own sign-up page. Without it, to the afterSignUpUrl of the provider, or /sign-up.
SignOutButtonRevokes the access token, clears the stored tokens, ends the session at LumoAuth, and goes to afterSignOutUrl.

Props​

SignInButton​

PropTypeDescription
childrenReactNodeYour own element. The component wraps it and adds the action.
signInUrlstringUsed only in password mode, which LumoAuth does not support. In the default mode the button goes to the hosted sign-in page.
classNamestringClass name for the default button. Not applied when you pass children.

SignUpButton​

PropTypeDescription
childrenReactNodeYour own element. The component wraps it and adds the action.
signUpUrlstringYour sign-up page. Defaults to the afterSignUpUrl of the provider, then to /sign-up.
classNamestringClass name for the default button. Not applied when you pass children.

SignOutButton​

PropTypeDescription
childrenReactNodeYour own element. The component wraps it and adds the action.
afterSignOutUrlstringWhere to go after sign-out. Defaults to the afterSignOutUrl of the provider, then to /.
classNamestringClass name for the default button. Not applied when you pass children.