<SignIn />
component
The <SignIn />
component renders a UI for signing in users. The functionality of the <SignIn />
component is controlled by the instance settings you specify in your Clerk Dashboard, such as sign-in and sign-up options and social connections. You can further customize your <SignIn />
component by passing additional properties at the time of rendering.
Properties
All props are optional.
- Name
appearance
- Type
Appearance | undefined
- Description
Optional object to style your components. Will only affect Clerk components and not Account Portal pages.
- Name
routing
- Type
'hash' | 'path' | 'virtual'
- Description
The routing strategy for your pages.
Defaults to'path'
in Next.js and Remix applications. Defaults tohash
for all other SDK's.
- Name
path
- Type
string
- Description
The path where the component is mounted on when
routing
is set topath
. It is ignored in hash- and virtual-based routing.
For example:/sign-in
.
- Name
signUpUrl
- Type
string
- Description
Full URL or path to the sign up page. Use this property to provide the target of the 'Sign Up' link that's rendered. It's recommended to use the environment variable instead.
- Name
forceRedirectUrl?
- Type
string
- Description
If provided, this URL will always be redirected to after the user signs in. Takes priority over deprecated props such as
afterSignInUrl
andredirectUrl
. It's recommended to use the environment variable instead.
- Name
fallbackRedirectUrl?
- Type
string
- Description
The fallback URL to redirect to after the user signs in, if there's no
redirect_url
in the path already. Defaults to/
. Takes priority over deprecated props such asafterSignInUrl
andredirectUrl
. It's recommended to use the environment variable instead.
- Name
signUpForceRedirectUrl?
- Type
string
- Description
If provided, this URL will always be redirected to after the user signs up. Takes priority over deprecated props such as
afterSignInUrl
andredirectUrl
. It's recommended to use the environment variable instead.
- Name
signUpFallbackRedirectUrl?
- Type
string
- Description
The fallback URL to redirect to after the user signs up, if there's no
redirect_url
in the path already. Defaults to/
. Takes priority over deprecated props such asafterSignInUrl
andredirectUrl
. It's recommended to use the environment variable instead.
- Name
initialValues
- Type
SignInInitialValues
- Description
The values used to prefill the sign-in fields with.
- Name
transferable?
- Type
boolean
- Description
Indicates whether or not sign in attempts are transferable to the sign up flow. Defaults to
true
. When set tofalse
, prevents opaque sign ups when a user attempts to sign in via OAuth with an email that doesn't exist. See OAuth account transfer flows for more details.
Usage with frameworks
The following example includes basic implementation of the <SignIn />
component. You can use this as a starting point for your own implementation.
The following example demonstrates how you can use the <SignIn />
component on a public page.
If you would like to create a dedicated /sign-in
page in your Next.js application, check out the dedicated guide..
Usage with JavaScript
The following methods available on an instance of the Clerk
class are used to render and control the <SignIn />
component:
The following examples assume that you have followed the quickstart in order to add Clerk to your JavaScript application.
mountSignIn()
Render the <SignIn />
component to an HTML <div>
element.
- Name
node
- Type
HTMLDivElement
- Description
The container
<div>
element used to render in the<SignIn />
component
- Name
props?
- Type
SignInProps
- Description
The properties to pass to the
<SignIn />
component
unmountSignIn()
Unmount and run cleanup on an existing <SignIn />
component instance.
- Name
node
- Type
HTMLDivElement
- Description
The container
<div>
element with a rendered<SignIn />
component instance
openSignIn()
Opens the <SignIn />
component as an overlay at the root of your HTML body
element.
- Name
props?
- Type
SignInProps
- Description
The properties to pass to the
<SignIn />
component.
closeSignIn()
Closes the sign in overlay.
Customization
To learn about how to customize Clerk components, see the customization documentation.
Feedback
Last updated on