Wocha Docs

SignIn

Styled sign-in form with social providers, passkeys, and hosted login redirect.

The <SignIn> component renders a production-ready sign-in card that redirects users to Wocha hosted login. It supports social providers, passkeys, layout options, and per-component theming.

Installation

pnpm add @wocha/ui @wocha/react
Or scaffold with the CLI
npx @wocha/cli init --framework nextjs
import { SignIn } from "@wocha/ui";
import "@wocha/ui/styles.css";

For Next.js, use @wocha/nextjs instead of @wocha/react and wrap your app with WochaSessionProvider.

Basic usage

import { WochaProvider } from "@wocha/react";
import { WochaThemeProvider, SignIn } from "@wocha/ui";
 
<WochaProvider config={config}>
  <WochaThemeProvider>
    <SignIn redirectUrl="/dashboard" />
  </WochaThemeProvider>
</WochaProvider>

Props

PropTypeDefaultDescription
redirectUrlstringURL to redirect to after successful sign-in
organisationstringOrganisation ID hint for the hosted login page
providersSocialProvider[]["google", "github", "microsoft", "apple"]Social sign-in buttons to display
appearanceWochaAppearanceVisual customisation for this component
withCardbooleantrueWrap content in AuthCard with default branding
titleReactNode"Sign in to continue"Card title override
descriptionReactNode"Welcome back…"Card description override
buttonLabelstring"Continue with Wocha"Primary button label
passkeysbooleanfalseShow passkey sign-in button
classNamestringAdditional class name on the root element
fallbackReactNodeShown while auth context is loading

SocialProvider is "google" | "github" | "microsoft" | "apple".

Layout options

Control non-CSS layout via appearance.options:

<SignIn
  providers={["google", "github"]}
  appearance={{
    options: {
      socialButtonsPlacement: "top",
      socialButtonsVariant: "block",
      logoPlacement: "outside",
      termsPageUrl: "/terms",
      privacyPageUrl: "/privacy",
    },
  }}
/>

Theming

Apply a prebuilt theme globally or override SignIn only:

import { minimal } from "@wocha/ui/themes";
 
<WochaThemeProvider
  appearance={{
    theme: minimal,
    signIn: {
      variables: { "--wocha-color-primary": "#6366f1" },
    },
  }}
>
  <SignIn />
</WochaThemeProvider>

Framework notes

FrameworkProvider setup
React SPAWochaProvider + WochaThemeProvider
Next.js App RouterWochaSessionProvider + WochaThemeProvider sdk="nextjs"

On this page