UI Components¶
Buttons¶
<SignInButton />¶
import reflex_clerk as clerk
import reflex as rx
clerk.sign_in_button(
rx.button("Sign In")
)
reflex_clerk.sign_in_button ¶
sign_in_button(
*children,
force_redirect_url=None,
fallback_redirect_url=None,
sign_up_force_redirect_url=None,
sign_up_fallback_redirect_url=None,
mode="redirect"
)
The
This button is un-styled, and is intended to wrap around an rx.button component.
Examples:
import reflex_clerk as clerk
def page():
clerk.clerk_provider(
rx.box(
clerk.sign_in_button(
rx.button("Sign In")
)
),
publishable_key="pk_my_publishable_key"
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*children |
Component
|
Zero or more child components that will be rendered inside the sign-in button. |
()
|
force_redirect_url |
Optional[str]
|
The URL to redirect to after the user successfully signs in. Defaults to None. |
None
|
fallback_redirect_url |
Optional[str]
|
The URL to redirect to if an error occurs during the sign-in process. Defaults to None. |
None
|
sign_up_force_redirect_url |
Optional[str]
|
The URL to redirect to after the user successfully signs up. Defaults to None. |
None
|
sign_up_fallback_redirect_url |
Optional[str]
|
The URL to redirect to if an error occurs during the sign-up process. Defaults to None. |
None
|
mode |
Literal['redirect', 'modal']
|
The mode of the sign-in button. It can be either 'redirect' or 'modal'. Defaults to None. |
'redirect'
|
Returns:
Type | Description |
---|---|
SignInButton
|
A SignInButton component instance that can be rendered. |
Source code in custom_components/reflex_clerk/lib/sign_in.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
|
<SignUpButton />¶
import reflex_clerk as clerk
import reflex as rx
clerk.sign_up_button(
rx.button("Sign Up")
)
reflex_clerk.sign_up_button ¶
sign_up_button(
*children,
force_redirect_url=None,
fallback_redirect_url=None,
sign_in_force_redirect_url=None,
sign_in_fallback_redirect_url=None,
mode="redirect"
)
The
This button is un-styled, and is intended to wrap around an rx.button component.
Examples:
import reflex_clerk as clerk
def page():
clerk.clerk_provider(
rx.box(
clerk.sign_up_button(
rx.button("Sign Up")
)
),
publishable_key="pk_my_publishable_key"
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
force_redirect_url |
str
|
The URL to redirect to after the user successfully signs in. Defaults to None. |
None
|
fallback_redirect_url |
str
|
The URL to redirect to if an error occurs during the sign-in process. Defaults to None. |
None
|
sign_in_force_redirect_url |
str
|
The URL to redirect to after the user successfully signs up. Defaults to None. |
None
|
sign_in_fallback_redirect_url |
str
|
The URL to redirect to if an error occurs during the sign-up process. Defaults to None. |
None
|
mode |
Literal['redirect', 'modal']
|
The mode of the sign-up button. It can be either 'redirect' or 'modal'. Defaults to 'redirect'. |
'redirect'
|
Returns:
Type | Description |
---|---|
SignUpButton
|
A SignUpButton component instance that can be rendered. |
Source code in custom_components/reflex_clerk/lib/sign_up.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
|
<SignOutButton />¶
import reflex_clerk as clerk
import reflex as rx
clerk.sign_out_button(
rx.button("Sign Out")
)
reflex_clerk.sign_out_button ¶
sign_out_button(*children, options=None, redirect_url=None)
The
This button is un-styled, and is intended to wrap around an rx.button component.
Examples:
import reflex_clerk as clerk
def page():
clerk.clerk_provider(
rx.box(
clerk.sign_out_button(
rx.button("Sign Out")
)
),
publishable_key="pk_my_publishable_key"
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*children |
Component
|
Zero or more child components that will be rendered inside the sign-out button. |
()
|
options |
SignOutOptions
|
Options for the sign-out button. Defaults to None. |
None
|
redirect_url |
str
|
The URL to redirect to after sign-out. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
SignOutButton
|
A SignOutButton component instance that can be rendered. |
Source code in custom_components/reflex_clerk/lib/sign_out.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
<UserButton />¶
import reflex_clerk as clerk
clerk.user_button()
reflex_clerk.user_button ¶
user_button(
*children,
appearance=None,
show_name=None,
sign_in_url=None,
user_profile_mode="modal",
user_profile_url=None,
after_sign_out_url=None,
after_multi_session_single_sign_out_url=None,
after_switch_session_url=None,
default_open=None,
user_profile_props=None
)
The
Examples:
import reflex_clerk as clerk
def page():
clerk.clerk_provider(
rx.box(
clerk.user_button()
),
publishable_key="pk_my_publishable_key"
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
appearance |
Appearance
|
Optional object to style the component. Will only affect Clerk Components and not Account Portal pages. |
None
|
show_name |
bool
|
Controls if the user name is displayed next to the user image button. Defaults to False. |
None
|
sign_in_url |
str
|
Full URL or path to navigate to when the Add another account button is clicked. |
None
|
user_profile_mode |
Literal['modal', 'navigation']
|
Controls whether clicking the Manage your account button will open the |
'modal'
|
user_profile_url |
str
|
Full URL or path leading to the user management interface. |
None
|
after_sign_out_url |
str
|
Full URL or path to navigate to after signing out from all accounts. Defaults to '/'. |
None
|
after_multi_session_single_sign_out_url |
str
|
Full URL or path to navigate to after signing out from the currently active account in multi-session apps. |
None
|
after_switch_session_url |
str
|
Full URL or path to navigate to after a successful account change in multi-session apps. |
None
|
default_open |
bool
|
Controls whether the |
None
|
user_profile_props |
dict
|
Options for the underlying |
None
|
Returns:
Type | Description |
---|---|
UserButton
|
A UserButton component instance that can be rendered. |
Source code in custom_components/reflex_clerk/lib/user.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
Authentication Components¶
<SignIn />¶
import reflex_clerk as clerk
clerk.sign_in()
The
Instead of using this component directly, consider using the pre-configured sign-in
page configured with reflex_clerk.install_signin_page
.
This form can be styled and configured with various routing and redirection options.
Examples:
import reflex_clerk as clerk
def page():
clerk.clerk_provider(
rx.box(
rx.heading("Welcome, please sign in!"),
clerk.sign_in()
),
publishable_key="pk_my_publishable_key"
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
appearance |
Appearance
|
The appearance configuration for the sign-in form. |
None
|
routing |
Literal['hash', 'path', 'virtual']
|
The routing strategy for the pages. Can be 'hash', 'path', or 'virtual'. Defaults to None. |
None
|
path |
str
|
The path where the component is mounted when routing is set to 'path'. Ignored for 'hash' and 'virtual' routing. |
None
|
sign_up_url |
str
|
Full URL or path to the sign-up page. |
None
|
force_redirect_url |
str
|
URL to redirect to after sign-in. Takes priority over deprecated props. |
None
|
fallback_redirect_url |
str
|
Fallback URL to redirect to after sign-in if no redirect URL is provided in the path. Defaults to '/'. |
None
|
sign_up_force_redirect_url |
str
|
URL to redirect to after sign-up. Takes priority over deprecated props. |
None
|
sign_up_fallback_redirect_url |
str
|
Fallback URL to redirect to after sign-up if no redirect URL is provided in the path. Defaults to '/'. |
None
|
initial_values |
Optional[SignInInitialValues]
|
Prefilled values for the sign-in fields. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
SignIn
|
A SignIn component instance that can be rendered. |
Source code in custom_components/reflex_clerk/lib/sign_in.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
|
<SignUp />¶
import reflex_clerk as clerk
clerk.sign_up()
The
Instead of using this component directly, consider using the pre-configured sign-in
page configured with reflex_clerk.install_signup_page
.
This form can be styled and configured with various routing and redirection options.
Examples:
import reflex_clerk as clerk
def page():
clerk.clerk_provider(
rx.box(
rx.heading("Welcome, please sign up!"),
clerk.sign_up()
),
publishable_key="pk_my_publishable_key"
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
appearance |
Appearance
|
The appearance configuration for the sign-up form. |
None
|
routing |
Literal['hash', 'path', 'virtual']
|
The routing strategy for the pages. Can be 'hash', 'path', or 'virtual'. Defaults to None. |
None
|
path |
str
|
The path where the component is mounted when routing is set to 'path'. Ignored for 'hash' and 'virtual' routing. |
None
|
sign_in_url |
str
|
Full URL or path to the sign-in page. |
None
|
force_redirect_url |
str
|
URL to redirect to after sign-in. Takes priority over deprecated props. |
None
|
fallback_redirect_url |
str
|
Fallback URL to redirect to after sign-in if no redirect URL is provided in the path. Defaults to '/'. |
None
|
sign_in_force_redirect_url |
str
|
URL to redirect to after sign-up. Takes priority over deprecated props. |
None
|
sign_in_fallback_redirect_url |
str
|
Fallback URL to redirect to after sign-up if no redirect URL is provided in the path. Defaults to '/'. |
None
|
initial_values |
Optional[SignUpInitialValues]
|
Prefilled values for the sign-up fields. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
SignUp
|
A SignUp component instance that can be rendered. |
Source code in custom_components/reflex_clerk/lib/sign_up.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
|
<UserProfile />¶
import reflex_clerk as clerk
clerk.user_profile()
reflex_clerk.user_profile ¶
user_profile(
*children, appearance=None, additional_oauth_scopes=None
)
The
Examples:
import reflex_clerk as clerk
def page():
clerk.clerk_provider(
rx.box(
clerk.user_profile()
),
publishable_key="pk_my_publishable_key"
)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*children |
Component
|
Zero or more child components that will be rendered inside the user profile component. |
()
|
appearance |
Appearance
|
Optional object to style the component. Will only affect Clerk Components and not Account Portal pages. |
None
|
additional_oauth_scopes |
dict
|
Specify additional scopes per OAuth provider that your users would like to provide if not already approved. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
UserProfile
|
A UserProfile component instance that can be rendered. |
Source code in custom_components/reflex_clerk/lib/user.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
|