# Sign in form (goodtabs UI)

Email and password sign in with a pending state, an or divider and provider buttons.

## Install

```bash
npx shadcn@latest add https://ui.goodtabs.co/r/sign-in-form.json
```

Or, with the @goodtabs namespace configured in components.json: `npx shadcn@latest add @goodtabs/sign-in-form`

## Usage

```tsx
import { SignInForm, SignInGitHubButton } from "@/components/sign-in-form"

<SignInForm
  signUpHref="/sign-up"
  forgotHref="/forgot"
  onSubmit={async ({ email, password }) => { await signIn(email, password) }}
  providers={<SignInGitHubButton onClick={() => signInWith("github")} />}
/>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| onSubmit | `({ email, password }) => void | Promise<void>` |  | Called with the values. A promise shows a pending state; a throw shows an error. |
| title | `string` | `"Sign in"` | Heading and submit label. |
| providers | `ReactNode` | `<SignInGitHubButton />` | Provider buttons under the divider. null hides the divider too. |
| signUpHref | `string` | `"#"` | Where Create an account goes. |
| forgotHref | `string` | `"#"` | Where Forgot? goes. |

## When to use

- The sign in page of an app with email and password
- A sign in dialog or sheet, since it is a form with no page chrome
- Apps that also offer one or two providers like GitHub or Google

## When not to use

- Sign up, which needs more fields and consent: build on form-section
- Magic link or passwordless flows, which have no password field
- Apps with many providers; a list of links reads better than a stack of buttons

## Notes for agents

- onSubmit is a function, so the page that renders SignInForm must be a client component ("use client")
- If onSubmit throws, a generic error shows under the password and the fields unlock; map your own errors there
- The default GitHub button has no handler; pass providers with your own SignInGitHubButton or links
- The form is max-w-sm and centers nothing; place it in your page layout

Docs: https://ui.goodtabs.co/components/sign-in-form