Skip to main content

Google Sign-In button

Native branded button (GIDSignInButton on iOS, SignInButton on Android) exposed as a Nitro HybridView.

Full prop and type listings: API reference — GoogleSignInButton.

Basic usage

import {
GoogleSignInButton,
GOOGLE_SIGN_IN_BUTTON_HEIGHT,
} from 'react-native-nitro-google-signin'

<GoogleSignInButton
style={{ width: 240, height: GOOGLE_SIGN_IN_BUTTON_HEIGHT }}
colorScheme="light"
size="standard"
signInBehavior="credentialManager"
onSignInSuccess={(data) => console.log(data.user.email, data.idToken)}
onSignInError={(e) => console.error(e)}
/>

Call GoogleOneTapSignIn.configure() before the button can sign in (same as programmatic API).

signInBehavior

ValueBehavior
credentialManager (default)checkPlayServicessignIncreateAccount if no saved credential (Credential Manager sheet on Android)
buttonFlowcheckPlayServicespresentExplicitSignIn (explicit account dialog on Android)
noneOnly your onPress handler — no built-in sign-in

Props (summary)

CategoryProps
AppearancecolorScheme ('light' | 'dark'), size ('standard' | 'wide' | 'icon'), contentAlignment, disabled
Sign-insignInBehavior, onSignInSuccess, onSignInError, onPress, loading
Layout / a11ystyle, testID, accessibilityLabel, accessibilityRole, accessibilityState, collapsable, nativeID
AdvancedhybridRef

Hook

useGoogleSignInFromButton exposes the same cascade for a custom Pressable:

const { loading, onPress } = useGoogleSignInFromButton({
behavior: 'credentialManager',
onSuccess: (data) => { /* OneTapSuccessData */ },
onError: (e) => { /* unknown */ },
})

<Pressable onPress={onPress} disabled={loading}>
<Text>Sign in</Text>
</Pressable>

See API reference — useGoogleSignInFromButton.

Constants

GOOGLE_SIGN_IN_BUTTON_HEIGHT = 48 (pt/dp per Google branding). Use for style.height.

Low-level export

GoogleSignInButtonHost — Nitro host component if you build a custom wrapper; most apps use GoogleSignInButton only.