# Sign-in form

A complete email-and-password sign-in block with native form behavior and consumer-owned authentication.

Access: pro. Category: Blocks. Kind: composite.

## When to use

- Use it when a page needs a complete email-and-password sign-in block with native form behavior and consumer-owned authentication.
- Choose it inside an authenticated product surface when the host application owns routing, persistence, and service calls.

## Alternatives

- Choose form-field instead when a labeled email field with validation and help text is the actual interface need, rather than sign-in form.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Sign-in form

```sh
npx shadcn@latest add @tidal-pro/sign-in-form
```

Stylesheets: `components/ui/tidal.css`, `components/ui/sign-in-form.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/sign-in-form.css";
import{TidalSignInForm}from"./components/ui/sign-in-form";
export default()=><div className="tidal-scope"><TidalSignInForm title={"Demo"}/></div>;
```

## Structured props

- `TidalSignInForm.title: string`: Required title value accepted by this exported component.
- `TidalSignInForm.busy?: boolean | undefined` (default false): Optional busy value accepted by this exported component.
- `TidalSignInForm.busyLabel?: string | undefined` (default "Signing in"): Optional busy label value accepted by this exported component.
- `TidalSignInForm.defaultPasswordRevealed?: boolean | undefined` (default false): Optional default password revealed value accepted by this exported component.
- `TidalSignInForm.description?: string | undefined`: Optional description value accepted by this exported component.
- `TidalSignInForm.emailError?: string | undefined`: Optional email error value accepted by this exported component.
- `TidalSignInForm.emailInputProps?: SignInInputProps | undefined`: Optional email input props value accepted by this exported component.
- `TidalSignInForm.emailLabel?: string | undefined` (default "Email address"): Optional email label value accepted by this exported component.
- `TidalSignInForm.emailRef?: Ref<HTMLInputElement> | undefined`: Optional email ref value accepted by this exported component.
- `TidalSignInForm.eyebrow?: string | undefined` (default "Account access"): Optional eyebrow value accepted by this exported component.
- `TidalSignInForm.footer?: ReactNode`: Optional footer value accepted by this exported component.
- `TidalSignInForm.formError?: string | undefined`: Optional form error value accepted by this exported component.
- `TidalSignInForm.formErrorRef?: Ref<HTMLDivElement> | undefined`: Optional form error ref value accepted by this exported component.
- `TidalSignInForm.headingLevel?: "h2" | "h3" | "h4" | undefined` (default "h2"): Optional heading level value accepted by this exported component.
- `TidalSignInForm.hidePasswordLabel?: string | undefined` (default "Hide password"): Optional hide password label value accepted by this exported component.
- `TidalSignInForm.onPasswordRevealedChange?: ((revealed: boolean) => void) | undefined`: Callback invoked when the password revealed change interaction is proposed.
- `TidalSignInForm.passwordError?: string | undefined`: Optional password error value accepted by this exported component.
- `TidalSignInForm.passwordInputProps?: SignInInputProps | undefined`: Optional password input props value accepted by this exported component.
- `TidalSignInForm.passwordLabel?: string | undefined` (default "Password"): Optional password label value accepted by this exported component.
- `TidalSignInForm.passwordRef?: Ref<HTMLInputElement> | undefined`: Optional password ref value accepted by this exported component.
- `TidalSignInForm.passwordRevealed?: boolean | undefined`: Optional password revealed value accepted by this exported component.
- `TidalSignInForm.showPasswordLabel?: string | undefined` (default "Show password"): Optional show password label value accepted by this exported component.
- `TidalSignInForm.submitButtonProps?: Omit<ButtonHTMLAttributes<HTMLButtonElement>, "type" | "children"> | undefined`: Optional submit button props value accepted by this exported component.
- `TidalSignInForm.submitLabel?: string | undefined` (default "Sign in"): Optional submit label value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/sign-in-form.tsx) | [Manifest](https://tidalui.com/examples/sign-in-form.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
import "./components/ui/tidal.css";

import { useEffect, useLayoutEffect, useRef, useState, type FormEvent } from "react";

import { CheckCircle2, FileCheck2, RotateCcw } from "lucide-react";

import { TidalSignInForm } from "./components/ui/sign-in-form";

import "./components/ui/sign-in-form.css";



const tidalExampleStyles = ".tidal-scope .sign-in-demo-specimen {\n  width: 100%;\n  max-width: 680px;\n  min-width: 0;\n  overflow: hidden;\n  border: 1px solid var(--t-border);\n  border-radius: 18px;\n  background: var(--t-subtle);\n  color: var(--t-ink);\n  box-shadow: 0 24px 48px -36px #00000052;\n  container-type: inline-size;\n}\n\n.tidal-scope .sign-in-demo-layout {\n  display: grid;\n  grid-template-columns: minmax(0, 1fr);\n  min-width: 0;\n}\n\n.tidal-scope .sign-in-demo-specimen,\n.tidal-scope .sign-in-demo-specimen * {\n  box-sizing: border-box;\n}\n\n.tidal-scope .sign-in-demo-kicker {\n  display: block;\n  color: var(--t-muted);\n  font-size: 11px;\n  font-weight: 600;\n  letter-spacing: 1px;\n  line-height: 1.4;\n}\n\n.tidal-scope .sign-in-demo-stage {\n  display: grid;\n  place-items: center;\n  min-width: 0;\n  padding: 28px;\n  background:\n    linear-gradient(var(--t-border) 1px, transparent 1px),\n    linear-gradient(90deg, var(--t-border) 1px, transparent 1px),\n    var(--t-subtle);\n  background-size: 22px 22px;\n}\n\n.tidal-scope .sign-in-demo-stage > .tidal-sign-in-form {\n  max-width: 450px;\n}\n\n.tidal-scope .sign-in-demo-prepared {\n  width: 100%;\n  max-width: 450px;\n  padding: 42px 31px;\n  border: 1px solid var(--t-border);\n  border-radius: 18px;\n  background: var(--t-surface);\n  text-align: center;\n  box-shadow: 0 22px 44px -34px #0000004a;\n}\n\n.tidal-scope .sign-in-demo-prepared-icon {\n  position: relative;\n  display: grid;\n  place-items: center;\n  width: 58px;\n  height: 58px;\n  margin: 0 auto 24px;\n  border-radius: 15px;\n  background: var(--t-ink);\n  color: var(--t-surface);\n  transform: rotate(-4deg);\n}\n\n.tidal-scope .sign-in-demo-prepared-icon > svg:last-child {\n  position: absolute;\n  inset-inline-end: -5px;\n  bottom: -5px;\n  box-sizing: content-box;\n  padding: 4px;\n  border: 3px solid var(--t-surface);\n  border-radius: 50%;\n  background: var(--t-surface);\n  color: var(--t-ink);\n}\n\n.tidal-scope .sign-in-demo-prepared h3 {\n  margin: 12px 0 11px;\n  color: var(--t-ink);\n  font-size: 25px;\n  font-weight: 500;\n  line-height: 1.15;\n  letter-spacing: -0.8px;\n  text-wrap: balance;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .sign-in-demo-prepared h3:focus {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 5px;\n  border-radius: 4px;\n}\n\n.tidal-scope .sign-in-demo-prepared > p {\n  max-width: 330px;\n  margin: 0 auto 24px;\n  color: var(--t-muted);\n  font-size: 11px;\n  line-height: 1.7;\n  overflow-wrap: anywhere;\n}\n\n.tidal-scope .sign-in-demo-prepared > button {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 8px;\n  min-height: 44px;\n  padding: 9px 14px;\n  border: 1px solid var(--t-border);\n  border-radius: 10px;\n  background: var(--t-surface);\n  color: var(--t-ink);\n  font: inherit;\n  font-size: 11px;\n  cursor: pointer;\n  transition:\n    background 160ms,\n    transform 140ms var(--t-ease-out);\n}\n\n.tidal-scope .sign-in-demo-prepared > button:hover {\n  background: var(--t-wash);\n}\n\n.tidal-scope .sign-in-demo-prepared > button:active {\n  transform: scale(0.98);\n}\n\n.tidal-scope .sign-in-demo-prepared > button:focus-visible {\n  outline: 2px solid var(--t-accent);\n  outline-offset: 3px;\n}\n\n@container (max-width: 390px) {\n  .tidal-scope .sign-in-demo-stage {\n    padding: 12px;\n    background-size: 18px 18px;\n  }\n\n  .tidal-scope .sign-in-demo-prepared {\n    padding: 34px 21px;\n  }\n}\n\n@media (prefers-reduced-motion: no-preference) {\n  .tidal-scope .sign-in-demo-prepared {\n    animation: sign-in-demo-enter 430ms var(--t-ease-out) both;\n  }\n\n  .tidal-scope .sign-in-demo-prepared-icon {\n    animation: sign-in-demo-icon 460ms var(--t-ease-spring) both;\n  }\n}\n\n@keyframes sign-in-demo-enter {\n  from {\n    opacity: 0;\n    transform: translateY(7px);\n  }\n  to {\n    opacity: 1;\n    transform: none;\n  }\n}\n\n@keyframes sign-in-demo-icon {\n  from {\n    opacity: 0;\n    transform: scale(0.7) rotate(-13deg);\n  }\n  to {\n    opacity: 1;\n    transform: scale(1) rotate(-4deg);\n  }\n}";

type DemoPhase = "ready" | "checking" | "prepared";

export function SignInFormDemo() {
  const [email, setEmail] = useState("");
  const [password, setPassword] = useState("");
  const [emailError, setEmailError] = useState("");
  const [passwordError, setPasswordError] = useState("");
  const [phase, setPhase] = useState<DemoPhase>("ready");
  const emailInput = useRef<HTMLInputElement>(null);
  const preparedHeading = useRef<HTMLHeadingElement>(null);
  const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);
  const restoreEmailFocus = useRef(false);
  const focusOwner = useRef<HTMLElement | null>(null);

  useEffect(() => () => clearTimeout(timer.current), []);

  useLayoutEffect(() => {
    if (phase === "prepared") {
      const active = document.activeElement;
      if (active === document.body || active === focusOwner.current)
        preparedHeading.current?.focus({ preventScroll: true });
      focusOwner.current = null;
    } else if (phase === "ready" && restoreEmailFocus.current) {
      restoreEmailFocus.current = false;
      emailInput.current?.focus({ preventScroll: true });
    }
  }, [phase]);

  function reset() {
    clearTimeout(timer.current);
    timer.current = undefined;
    focusOwner.current = null;
    setEmail("");
    setPassword("");
    setEmailError("");
    setPasswordError("");
    restoreEmailFocus.current = true;
    setPhase("ready");
  }

  function cancelPreparationOnEdit() {
    if (phase !== "checking") return;
    clearTimeout(timer.current);
    timer.current = undefined;
    focusOwner.current = null;
    setPhase("ready");
  }

  function handleSubmit(event: FormEvent<HTMLFormElement>) {
    event.preventDefault();
    clearTimeout(timer.current);
    focusOwner.current =
      (event.nativeEvent as SubmitEvent).submitter instanceof HTMLElement
        ? (event.nativeEvent as SubmitEvent).submitter
        : document.activeElement instanceof HTMLElement
          ? document.activeElement
          : null;
    setEmailError("");
    setPasswordError("");
    setPhase("checking");
    timer.current = setTimeout(() => {
      timer.current = undefined;
      setEmail("");
      setPassword("");
      setPhase("prepared");
    }, 680);
  }

  return (
    <section className="sign-in-demo-specimen" data-phase={phase}>
      <div className="sign-in-demo-layout">
        <div className="sign-in-demo-stage">
          {phase === "prepared" ? (
            <div className="sign-in-demo-prepared">
              <span className="sign-in-demo-prepared-icon" aria-hidden="true">
                <FileCheck2 size={24} />
                <CheckCircle2 size={15} />
              </span>
              <span className="sign-in-demo-kicker">LOCAL CHECK COMPLETE</span>
              <h3 ref={preparedHeading} tabIndex={-1}>
                Form prepared locally.
              </h3>
              <p>
                The sample passed browser validation. No account was checked, no
                sign-in happened, and no values were saved.
              </p>
              <button type="button" onClick={reset}>
                <RotateCcw size={16} aria-hidden="true" />
                Return to form
              </button>
            </div>
          ) : (
            <TidalSignInForm
              title="Sign in to your workspace"
              description="Enter your account details to continue."
              headingLevel="h3"
              emailRef={emailInput}
              emailError={emailError}
              passwordError={passwordError}
              busy={phase === "checking"}
              busyLabel="Preparing form"
              submitLabel="Continue"
              onSubmit={handleSubmit}
              emailInputProps={{
                value: email,
                placeholder: "name@example.com",
                inputMode: "email",
                onChange: (event: import("react").ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
                  cancelPreparationOnEdit();
                  setEmail(event.target.value);
                  setEmailError("");
                },
                onInvalid: (event: import("react").InvalidEvent<HTMLInputElement>) => {
                  const input = event.currentTarget;
                  setEmailError(
                    input.validity.valueMissing
                      ? "Enter an email address to continue."
                      : "Use an email address in the format name@example.com.",
                  );
                },
              }}
              passwordInputProps={{
                value: password,
                placeholder: "Sample only",
                onChange: (event: import("react").ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
                  cancelPreparationOnEdit();
                  setPassword(event.target.value);
                  setPasswordError("");
                },
                onInvalid: () => {
                  setPasswordError("Enter a sample password to continue.");
                },
              }}
              footer={
                <span>
                  Preview only. Authentication and account recovery are not
                  connected.
                </span>
              }
            />
          )}
        </div>
      </div>
    </section>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <SignInFormDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order.","Arrow-key behavior follows the exported composite-control implementation."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

title required. Native form attributes and ref are forwarded, including action, method, target, noValidate, onSubmit and onReset. Optional description, eyebrow, headingLevel, labels, field/form errors, native emailInputProps/passwordInputProps, emailRef/passwordRef/formErrorRef, submit labels, consumer-owned busy state, native submitButtonProps including formAction/formMethod, controlled or uncontrolled password reveal, reveal labels and footer. Email/password types remain semantic; required defaults true; autocomplete defaults to email/current-password. An unprevented native reset restores uncontrolled reveal to its default; controlled reveal remains caller-owned. The component performs no authentication, request, storage, credential logging, recovery or password-policy checks.
