# Auth Layout

Centered or split frames for sign-in, sign-up, and recovery pages.

Page: https://sui.draco.dev/docs/layouts/auth-layout

Adapted from the shadcn-admin authentication pages. The layout only places the brand and your form; it has no routing.

## Centered

### Example: layout-auth

```tsx
"use client";

import {
  AuthLayout,
  AuthLayoutBrand,
  AuthLayoutContent,
} from "@workspace/ui/layouts/auth-layout";
import { Command } from "lucide-react";
import { SignInForm } from "../support/layout-sign-in";
import type { ExampleProps } from "../types";

export default function LayoutAuth({ locale }: ExampleProps) {
  const zh = locale === "zh-CN";
  return (
    <AuthLayout className="min-h-0 w-full rounded-xl border bg-muted/30">
      <AuthLayoutContent>
        <AuthLayoutBrand>
          <Command className="size-5" />
          Acme Inc
        </AuthLayoutBrand>
        <SignInForm zh={zh} />
      </AuthLayoutContent>
    </AuthLayout>
  );
}
```

## Split

`variant="split"` places a panel beside the form from the `lg` breakpoint. Put artwork, a quote, or product screenshots in `AuthLayoutAside`.

### Example: layout-auth-split

```tsx
"use client";

import {
  AuthLayout,
  AuthLayoutAside,
  AuthLayoutBrand,
  AuthLayoutContent,
} from "@workspace/ui/layouts/auth-layout";
import { Command } from "lucide-react";
import { SignInForm } from "../support/layout-sign-in";
import type { ExampleProps } from "../types";

export default function LayoutAuthSplit({ locale }: ExampleProps) {
  const zh = locale === "zh-CN";
  return (
    <AuthLayout
      variant="split"
      className="min-h-0 w-full overflow-hidden rounded-xl border"
    >
      <AuthLayoutContent>
        <AuthLayoutBrand>
          <Command className="size-5" />
          Acme Inc
        </AuthLayoutBrand>
        <SignInForm zh={zh} />
      </AuthLayoutContent>
      <AuthLayoutAside className="bg-gradient-to-br from-primary/20 via-muted to-muted">
        <blockquote className="absolute inset-x-8 bottom-8 space-y-2">
          <p className="text-lg">
            {zh
              ? "“这个后台让团队每周节省了好几个小时。”"
              : "“This dashboard saves our team hours every week.”"}
          </p>
          <footer className="text-muted-foreground text-sm">Sofia Davis</footer>
        </blockquote>
      </AuthLayoutAside>
    </AuthLayout>
  );
}
```

## Installation

```bash
npx shadcn@latest add @sui/auth-layout
```

With pnpm, Yarn or Bun, use `pnpm dlx`, `yarn dlx` or `bunx --bun` in place of `npx`, and `pnpm add`, `yarn add` or `bun add` in place of `npm install`.

## Usage

```tsx
import {
  AuthLayout,
  AuthLayoutAside,
  AuthLayoutBrand,
  AuthLayoutContent,
} from "@workspace/ui/layouts/auth-layout"

<AuthLayout variant="split">
  <AuthLayoutContent>
    <AuthLayoutBrand>
      <Logo />
      Acme Inc
    </AuthLayoutBrand>
    <SignInForm />
  </AuthLayoutContent>
  <AuthLayoutAside className="bg-linear-to-br from-primary/20 to-muted">
    <Testimonial />
  </AuthLayoutAside>
</AuthLayout>
```

## API

| Component | Description |
| --- | --- |
| `AuthLayout` | Page frame. `variant` is `centered` (default) or `split`; `split` adds a second column from `lg` up. |
| `AuthLayoutContent` | Centered form column, at most `max-w-sm` wide. |
| `AuthLayoutBrand` | Logo and product name above the form. |
| `AuthLayoutAside` | Split only: panel beside the form, hidden below `lg`. |

Every part accepts the props of its `div`, including `className`.
