# App, sign in

- **[Sections](/blocks/)**
- **[Application](/blocks/app/)**
- **App, sign in**

Sign in with email and password, or email and a code (signInWith code, with optional Continue with Google and Continue with Microsoft buttons, each in its provider…

## Import

- **CLI**

  ```
  npx shadcn add @klarhimmel/app-auth-signin
  ```
- **Import**

  ```
  import Block from '@/components/klarhimmel/blocks/app-auth-signin';
  ```

Also called

- app/auth-signin

- **About**: Sign in with email and password, or email and a code (signInWith code, with optional Continue with Google and Continue with Microsoft buttons, each in its provider colour mark): labelled fields with the right autocomplete, a button that…
- **Category**: Interface sections for signed-in products. New project? Set it up once: /get-started/installation.

## Notes

- **When to use it**: The standard email and password sign-in form. If the person has forgotten the password, `app-auth-reset` is the follow-up; for a new account use `app-auth-signup`.
- **Writing for it**: - `emailLabel` and `passwordLabel` are required, 40 characters at most; write Email address and Password, not instructions, because they are the field names read aloud.
- The password field has a show and hide button whose words come from `showLabel` and `hideLabel` (30 each). Make them different words, so the state is clear to someone not seeing the icon.
- `alternative` pairs a question of up to 80 characters with a link, such as No account yet? and Create one, and sits under the form.
- **Watch out for**: It never submits unless the host supplies an `action` or handles the submit. The error banner is not tied to a field: `messages.error` (160) must say what went wrong in general, because the fields are only described by that banner.

## Pairs well with

- **[App, sign up](/blocks/app/auth-signup)**
- **[App, reset password](/blocks/app/auth-reset)**
- **[App, one-time code](/blocks/app/auth-code)**

## Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx

```
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import AppAuthSignin from '@/components/klarhimmel/blocks/app-auth-signin';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <AppAuthSignin props={{
          "eyebrow": "Name the section",
          "google": {
            "label": "Continue with a provider",
            "href": "#google"
          },
          "microsoft": {
            "label": "Continue with another",
            "href": "#microsoft"
          },
          "orLabel": "or",
          "title": "Sign in",
          "description": "Say which details to use to get in.",
          "emailLabel": "Email address",
          "passwordLabel": "Password",
          "showLabel": "Show password",
          "hideLabel": "Hide password",
          "forgot": {
            "label": "Forgot your password?",
            "href": "#reset"
          },
          "submit": "Sign in",
          "sending": "Signing in…",
          "alternative": {
            "text": "No account yet?",
            "link": {
              "label": "Create one",
              "href": "#sign-up"
            }
          },
          "state": "idle",
          "messages": {
            "error": "Say that the details do not match and to check them."
          }
        }} />
      </BlockSurface>
    </Theme>
  );
}
```

## Props

The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.

- **signInWith**: One of 'password', 'code'. Optional; empty is not rendered.
- **google**: Optional; empty is not rendered.
- **microsoft**: Optional; empty is not rendered.
- **orLabel**: Text, up to 20 characters. Optional; empty is not rendered.
- **eyebrow**: Text, up to 60 characters. Optional; empty is not rendered.
- **title**: Text, up to 120 characters.
- **description**: Text, up to 300 characters. Optional; empty is not rendered.
- **emailLabel**: Text, up to 40 characters.
- **passwordLabel**: Text, up to 40 characters.
- **showLabel**: Text, up to 30 characters.
- **hideLabel**: Text, up to 30 characters.
- **forgot**: See the type.
- **submit**: Text, up to 30 characters.
- **sending**: Text, up to 30 characters.
- **alternative**: Fields: text, link.
- **state**: One of 'idle', 'sending', 'error'.
- **messages**: Fields: error.
- **action**: Text, up to 300 characters. Optional; empty is not rendered.
- **method**: One of 'post', 'get'. Optional; empty is not rendered.
- **hidden**: Optional; empty is not rendered.
- **captcha**: Optional; empty is not rendered.
- **captchaSitekey**: Text, up to 100 characters. Optional; empty is not rendered.
- **headingLevel**: One of '1', '2'. Optional; empty is not rendered.

[Previous](/blocks/app/auth-reset)

[Next](/blocks/app/auth-signup)
