> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt.

# `<apple-sign-in-button>`

The button that starts [Sign in with Apple](/api/angular-lynx/accounts/apple-sign-in.md), drawn as Apple's [guidelines](https://developer.apple.com/design/human-interface-guidelines/sign-in-with-apple) ask: the Apple logo, one of Apple's titles, its colors and its corners. App Review checks the button against them, so use this rather than drawing your own.

- **Its title is in the app's language,** as Apple asks. The button the runtime draws off iOS takes it from the app's `LOCALE_ID`, which [`provideLocale()`](/guide/i18n/index.md#set-up) sets from the phone's language, in the words iOS's own button uses. It's English for a language iOS has no title in.
- **Lynx has no such element.** This one is AngularLynx's.

## Usage

```typescript title="src/app/sign-in.ts"
import { Component, inject } from '@angular/core';
import { LYNX_ELEMENTS, LynxAppleSignIn } from '@blotch/angular-lynx';

@Component({
  selector: 'app-sign-in',
  imports: [LYNX_ELEMENTS],
  template: `
    <apple-sign-in-button
      type="continue"
      button-style="black"
      class="h-12 w-full"
      (bindtap)="signIn()"
    />
  `,
})
export class SignIn {
  readonly #appleSignIn = inject(LynxAppleSignIn);

  async signIn() {
    const result = await this.#appleSignIn.signIn({ scopes: ['email'] });
    // Send the result to your server.
  }
}
```

Import `LYNX_ELEMENTS` in your component (see [Elements](/api/angular-lynx/elements/index.md)).

**Give it a size, with classes or an inline style.** Like iOS's own button, it has none of its own. Apple asks for at least 140 × 30, and 44 tall is the usual height. A CSS rule naming the tag (`apple-sign-in-button { … }`) styles only iOS's button: the one the runtime draws is a `<view>`, which it doesn't match. It takes no children.

## Attributes

| Attribute       | Type                                   | Default    | Description                                                                                                  |
| --------------- | -------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------ |
| `type`          | `'signIn' \| 'continue' \| 'signUp'`   | `'signIn'` | The title: "Sign in with Apple", "Continue with Apple" or "Sign up with Apple"                               |
| `button-style`  | `'black' \| 'white' \| 'whiteOutline'` | `'black'`  | Black with a white logo and title, white with black ones, or white outlined in black, for a white background |
| `corner-radius` | `number \| string`                     | `6`        | The corners' radius, in points on iOS and pixels elsewhere. Half the height makes a pill                     |

Apple asks for a white button on a dark background, and a black one on a light background. So if the app follows the phone's [light or dark appearance](/api/angular-lynx/device/theme.md), switch `button-style` with it.

## Events

`bindtap`, as on any element. Call [`LynxAppleSignIn.signIn()`](/api/angular-lynx/accounts/apple-sign-in.md#signin) from it.

## Platform support

| Where                                                                                                                                                              | What draws it                                                                                                          |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| iOS apps built with [`ng build --platform ios`](/guide/building-for-production.md) and [`signInWithApple`](/api/angular-lynx/accounts/apple-sign-in.md#turn-it-on) | iOS's own `ASAuthorizationAppleIDButton`. Its title follows the phone's language, and it highlights while it's pressed |
| Android apps, the web preview, Lynx Explorer, and iOS apps without `signInWithApple`                                                                               | The runtime, to the same guidelines: the logo, the title in the app's `LOCALE_ID`, the colors and the corners          |

On Android, sign in through Apple's web flow with [`LynxWebAuthSession`](/api/angular-lynx/accounts/web-auth-session.md), where Apple's guidelines ask for the same button. In the web preview and Lynx Explorer, which have no sign-in, use [`isAvailable()`](/api/angular-lynx/accounts/apple-sign-in.md#isavailable) to leave the button out.

## Testing

In the [testing library](/api/testing-library/index.md), the button is iOS's element while the fake Sign in with Apple module is there, as it is by default: `document.querySelector('apple-sign-in-button')` finds it, with its attributes. After [`setAppleSignInAvailable(false)`](/api/testing-library/fakes/accounts.md#setapplesigninavailable), it's the one the runtime draws, whose title `screen.getByText('Sign in with Apple')` finds in an English app. A spec that gives `render()` another `LOCALE_ID` in its `providers` finds that language's title. `fireEvent.tap()` taps either.

## Related

- [`LynxAppleSignIn`](/api/angular-lynx/accounts/apple-sign-in.md): the sheet the button opens
- Apple's [Sign in with Apple guidelines](https://developer.apple.com/design/human-interface-guidelines/sign-in-with-apple)
