Skip to main content

Sign-in button

The package ships no UI. The example app has an AppleSignInButton built from NitroUI views on top of AppleSignIn.signIn, styled to Apple's Human Interface Guidelines. Copy these two files into your app:

Preview​

Sign in with Apple
buttonStyle
text
disabled

A web rendering of the same colors, labels and metrics as AppleSignInButton.tsx: 44 pt high, 16 pt horizontal padding, a 17 pt logo and 17 pt semibold label 6 pt apart, and 0.38 opacity while disabled or busy.

Usage​

{
AppleSignIn.isSupported() && (
<AppleSignInButton
buttonStyle="black" // black, white or whiteOutline
text="continue" // signIn, signUp or continue
options={{ scopes: ['fullName', 'email'] }}
onSignIn={(credential) => sendToBackend(credential.identityToken)}
onCancel={() => {}}
onError={(error) => showError(getAppleSignInErrorCode(error))}
/>
)
}

The button ignores taps while sign-in runs, so a double tap never rejects with IN_PROGRESS. Render it only when AppleSignIn.isSupported() returns true.

Props​

PropTypeDefaultDescription
onSignIn(credential: AppleCredential) => voidrequiredReceives the credential after a successful sign-in.
onCancel() => voidCalled when the user closes Apple's sheet.
onError(error: unknown) => voidReceives failures. Left out, failures reject unhandled.
optionsAppleSignInOptionsPassed to AppleSignIn.signIn on every tap.
text'signIn' | 'signUp' | 'continue''signIn'The label.
buttonStyle'black' | 'white' | 'whiteOutline''black'Use white or whiteOutline on dark backgrounds.
cornerRadiusnumber6Corner radius in points.
disabledbooleanfalseDims the button and ignores taps.
layoutViewProps['layout']Outer layout such as margins or width; the button keeps its height and padding.

Styles and labels​

buttonStyleBackgroundBorderContent
black#000000none#FFFFFF
white#FFFFFFnone#000000
whiteOutline#FFFFFF1 pt #000000#000000
textLabel
signInSign in with Apple
signUpSign up with Apple
continueContinue with Apple