Skip to content

Control components

Stub file for reflex_clerk_api/control_components.py

ClerkLoaded

Bases: ClerkBase

Only renders children after authentication has been checked.

Source code in custom_components/reflex_clerk_api/control_components.py
 9
10
11
12
class ClerkLoaded(ClerkBase):
    """Only renders children after authentication has been checked."""

    tag = "ClerkLoaded"

create(*children, style=None, key=None, id=None, ref=None, class_name=None, custom_attrs=None, on_blur=None, on_click=None, on_context_menu=None, on_double_click=None, on_focus=None, on_mount=None, on_mouse_down=None, on_mouse_enter=None, on_mouse_leave=None, on_mouse_move=None, on_mouse_out=None, on_mouse_over=None, on_mouse_up=None, on_scroll=None, on_scroll_end=None, on_unmount=None, **props) classmethod

Create the component.

Parameters:

Name Type Description Default
*children

The children of the component.

()
style Sequence[Mapping[str, Any]] | Mapping[str, Any] | Var[Mapping[str, Any]] | Breakpoints | None

The style of the component.

None
key Any | None

A unique key for the component.

None
id Any | None

The id for the component.

None
ref Var | None

The Var to pass as the ref to the component.

None
class_name Any | None

The class name for the component.

None
custom_attrs dict[str, Var | Any] | None

custom attribute

None
**props

The props of the component.

{}

Returns:

Type Description
ClerkLoaded

The component.

Source code in custom_components/reflex_clerk_api/control_components.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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
    permission: str | None = None
    "Optional string corresponding to a Role's Permission in the format org:<resource>:<action>"
    role: str | None = None
    "Optional string corresponding to an Organization's Role in the format org:<role>"


class RedirectToSignIn(ClerkBase):
    """Immediately redirects the user to the sign in page when rendered."""

    tag = "RedirectToSignIn"

    sign_in_fallback_redirect_url: str | None = None
    "The fallback URL to redirect to after the user signs in, if there's no redirect_url in the path already. Defaults to /."
    sign_in_force_redirect_url: str | None = None
    "If provided, this URL will always be redirected to after the user signs in."
    initial_values: SignInInitialValues | None = None
    "The values used to prefill the sign-in fields with."


class RedirectToSignUp(ClerkBase):
    """Immediately redirects the user to the sign up page when rendered."""

    tag = "RedirectToSignUp"

    sign_up_fallback_redirect_url: str | None = None
    "The fallback URL to redirect to after the user signs up, if there's no redirect_url in the path already. Defaults to /."
    sign_up_force_redirect_url: str | None = None
    "If provided, this URL will always be redirected to after the user signs up."
    initial_values: SignUpInitialValues | None = None
    "The values used to prefill the sign-up fields with."


class RedirectToUserProfile(ClerkBase):
    """Immediately redirects the user to their profile page when rendered."""

    tag = "RedirectToUserProfile"


class RedirectToOrganizationProfile(ClerkBase):
    tag = "RedirectToOrganizationProfile"


class RedirectToCreateOrganization(ClerkBase):
    tag = "RedirectToCreateOrganization"


class SignedIn(ClerkBase):

ClerkLoading

Bases: ClerkBase

Only renders childen while Clerk authenticates the user.

Source code in custom_components/reflex_clerk_api/control_components.py
15
16
17
18
class ClerkLoading(ClerkBase):
    """Only renders childen while Clerk authenticates the user."""

    tag = "ClerkLoading"

create(*children, style=None, key=None, id=None, ref=None, class_name=None, custom_attrs=None, on_blur=None, on_click=None, on_context_menu=None, on_double_click=None, on_focus=None, on_mount=None, on_mouse_down=None, on_mouse_enter=None, on_mouse_leave=None, on_mouse_move=None, on_mouse_out=None, on_mouse_over=None, on_mouse_up=None, on_scroll=None, on_scroll_end=None, on_unmount=None, **props) classmethod

Create the component.

Parameters:

Name Type Description Default
*children

The children of the component.

()
style Sequence[Mapping[str, Any]] | Mapping[str, Any] | Var[Mapping[str, Any]] | Breakpoints | None

The style of the component.

None
key Any | None

A unique key for the component.

None
id Any | None

The id for the component.

None
ref Var | None

The Var to pass as the ref to the component.

None
class_name Any | None

The class name for the component.

None
custom_attrs dict[str, Var | Any] | None

custom attribute

None
**props

The props of the component.

{}

Returns:

Type Description
ClerkLoading

The component.

Source code in custom_components/reflex_clerk_api/control_components.py
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
    tag = "SignedIn"


class SignedOut(ClerkBase):
    """Only renders children when the user is signed out."""

    tag = "SignedOut"


clerk_loaded = ClerkLoaded.create
clerk_loading = ClerkLoading.create
protect = Protect.create
redirect_to_sign_in = RedirectToSignIn.create
redirect_to_sign_up = RedirectToSignUp.create
redirect_to_user_profile = RedirectToUserProfile.create
redirect_to_organization_profile = RedirectToOrganizationProfile.create
redirect_to_create_organization = RedirectToCreateOrganization.create
signed_in = SignedIn.create
signed_out = SignedOut.create

Protect

Bases: ClerkBase

Optional conditional logic that renders the children if it returns true

Source code in custom_components/reflex_clerk_api/control_components.py
21
22
23
24
25
26
27
28
29
30
31
class Protect(ClerkBase):
    tag = "Protect"

    condition: Javascript | None = None
    "Optional conditional logic that renders the children if it returns true"
    fallback: JSX | None = None
    "An optional snippet of JSX to show when a user doesn't have the role or permission to access the protected content."
    permission: str | None = None
    "Optional string corresponding to a Role's Permission in the format org:<resource>:<action>"
    role: str | None = None
    "Optional string corresponding to an Organization's Role in the format org:<role>"

condition = None class-attribute instance-attribute

Optional conditional logic that renders the children if it returns true

fallback = None class-attribute instance-attribute

An optional snippet of JSX to show when a user doesn't have the role or permission to access the protected content.

permission = None class-attribute instance-attribute

Optional string corresponding to a Role's Permission in the format org::

role = None class-attribute instance-attribute

Optional string corresponding to an Organization's Role in the format org:

create(*children, condition=None, fallback=None, permission=None, role=None, style=None, key=None, id=None, ref=None, class_name=None, custom_attrs=None, on_blur=None, on_click=None, on_context_menu=None, on_double_click=None, on_focus=None, on_mount=None, on_mouse_down=None, on_mouse_enter=None, on_mouse_leave=None, on_mouse_move=None, on_mouse_out=None, on_mouse_over=None, on_mouse_up=None, on_scroll=None, on_scroll_end=None, on_unmount=None, **props) classmethod

Create the component.

Parameters:

Name Type Description Default
*children

The children of the component.

()
style Sequence[Mapping[str, Any]] | Mapping[str, Any] | Var[Mapping[str, Any]] | Breakpoints | None

The style of the component.

None
key Any | None

A unique key for the component.

None
id Any | None

The id for the component.

None
ref Var | None

The Var to pass as the ref to the component.

None
class_name Any | None

The class name for the component.

None
custom_attrs dict[str, Var | Any] | None

custom attribute

None
**props

The props of the component.

{}

Returns:

Type Description
Protect

The component.

RedirectToSignIn

Bases: ClerkBase

Immediately redirects the user to the sign in page when rendered.

Source code in custom_components/reflex_clerk_api/control_components.py
34
35
36
37
38
39
40
41
42
43
44
class RedirectToSignIn(ClerkBase):
    """Immediately redirects the user to the sign in page when rendered."""

    tag = "RedirectToSignIn"

    sign_in_fallback_redirect_url: str | None = None
    "The fallback URL to redirect to after the user signs in, if there's no redirect_url in the path already. Defaults to /."
    sign_in_force_redirect_url: str | None = None
    "If provided, this URL will always be redirected to after the user signs in."
    initial_values: SignInInitialValues | None = None
    "The values used to prefill the sign-in fields with."

sign_in_fallback_redirect_url = None class-attribute instance-attribute

The fallback URL to redirect to after the user signs in, if there's no redirect_url in the path already. Defaults to /.

sign_in_force_redirect_url = None class-attribute instance-attribute

If provided, this URL will always be redirected to after the user signs in.

initial_values = None class-attribute instance-attribute

The values used to prefill the sign-in fields with.

create(*children, sign_in_fallback_redirect_url=None, sign_in_force_redirect_url=None, initial_values=None, style=None, key=None, id=None, ref=None, class_name=None, custom_attrs=None, on_blur=None, on_click=None, on_context_menu=None, on_double_click=None, on_focus=None, on_mount=None, on_mouse_down=None, on_mouse_enter=None, on_mouse_leave=None, on_mouse_move=None, on_mouse_out=None, on_mouse_over=None, on_mouse_up=None, on_scroll=None, on_scroll_end=None, on_unmount=None, **props) classmethod

Create the component.

Parameters:

Name Type Description Default
*children

The children of the component.

()
style Sequence[Mapping[str, Any]] | Mapping[str, Any] | Var[Mapping[str, Any]] | Breakpoints | None

The style of the component.

None
key Any | None

A unique key for the component.

None
id Any | None

The id for the component.

None
ref Var | None

The Var to pass as the ref to the component.

None
class_name Any | None

The class name for the component.

None
custom_attrs dict[str, Var | Any] | None

custom attribute

None
**props

The props of the component.

{}

Returns:

Type Description
RedirectToSignIn

The component.

RedirectToSignUp

Bases: ClerkBase

Immediately redirects the user to the sign up page when rendered.

Source code in custom_components/reflex_clerk_api/control_components.py
47
48
49
50
51
52
53
54
55
56
57
class RedirectToSignUp(ClerkBase):
    """Immediately redirects the user to the sign up page when rendered."""

    tag = "RedirectToSignUp"

    sign_up_fallback_redirect_url: str | None = None
    "The fallback URL to redirect to after the user signs up, if there's no redirect_url in the path already. Defaults to /."
    sign_up_force_redirect_url: str | None = None
    "If provided, this URL will always be redirected to after the user signs up."
    initial_values: SignUpInitialValues | None = None
    "The values used to prefill the sign-up fields with."

sign_up_fallback_redirect_url = None class-attribute instance-attribute

The fallback URL to redirect to after the user signs up, if there's no redirect_url in the path already. Defaults to /.

sign_up_force_redirect_url = None class-attribute instance-attribute

If provided, this URL will always be redirected to after the user signs up.

initial_values = None class-attribute instance-attribute

The values used to prefill the sign-up fields with.

create(*children, sign_up_fallback_redirect_url=None, sign_up_force_redirect_url=None, initial_values=None, style=None, key=None, id=None, ref=None, class_name=None, custom_attrs=None, on_blur=None, on_click=None, on_context_menu=None, on_double_click=None, on_focus=None, on_mount=None, on_mouse_down=None, on_mouse_enter=None, on_mouse_leave=None, on_mouse_move=None, on_mouse_out=None, on_mouse_over=None, on_mouse_up=None, on_scroll=None, on_scroll_end=None, on_unmount=None, **props) classmethod

Create the component.

Parameters:

Name Type Description Default
*children

The children of the component.

()
style Sequence[Mapping[str, Any]] | Mapping[str, Any] | Var[Mapping[str, Any]] | Breakpoints | None

The style of the component.

None
key Any | None

A unique key for the component.

None
id Any | None

The id for the component.

None
ref Var | None

The Var to pass as the ref to the component.

None
class_name Any | None

The class name for the component.

None
custom_attrs dict[str, Var | Any] | None

custom attribute

None
**props

The props of the component.

{}

Returns:

Type Description
RedirectToSignUp

The component.

RedirectToUserProfile

Bases: ClerkBase

Immediately redirects the user to their profile page when rendered.

Source code in custom_components/reflex_clerk_api/control_components.py
60
61
62
63
class RedirectToUserProfile(ClerkBase):
    """Immediately redirects the user to their profile page when rendered."""

    tag = "RedirectToUserProfile"

create(*children, style=None, key=None, id=None, ref=None, class_name=None, custom_attrs=None, on_blur=None, on_click=None, on_context_menu=None, on_double_click=None, on_focus=None, on_mount=None, on_mouse_down=None, on_mouse_enter=None, on_mouse_leave=None, on_mouse_move=None, on_mouse_out=None, on_mouse_over=None, on_mouse_up=None, on_scroll=None, on_scroll_end=None, on_unmount=None, **props) classmethod

Create the component.

Parameters:

Name Type Description Default
*children

The children of the component.

()
style Sequence[Mapping[str, Any]] | Mapping[str, Any] | Var[Mapping[str, Any]] | Breakpoints | None

The style of the component.

None
key Any | None

A unique key for the component.

None
id Any | None

The id for the component.

None
ref Var | None

The Var to pass as the ref to the component.

None
class_name Any | None

The class name for the component.

None
custom_attrs dict[str, Var | Any] | None

custom attribute

None
**props

The props of the component.

{}

Returns:

Type Description
RedirectToUserProfile

The component.

RedirectToOrganizationProfile

Bases: ClerkBase

Source code in custom_components/reflex_clerk_api/control_components.py
66
67
class RedirectToOrganizationProfile(ClerkBase):
    tag = "RedirectToOrganizationProfile"

create(*children, style=None, key=None, id=None, ref=None, class_name=None, custom_attrs=None, on_blur=None, on_click=None, on_context_menu=None, on_double_click=None, on_focus=None, on_mount=None, on_mouse_down=None, on_mouse_enter=None, on_mouse_leave=None, on_mouse_move=None, on_mouse_out=None, on_mouse_over=None, on_mouse_up=None, on_scroll=None, on_scroll_end=None, on_unmount=None, **props) classmethod

Create the component.

Parameters:

Name Type Description Default
*children

The children of the component.

()
style Sequence[Mapping[str, Any]] | Mapping[str, Any] | Var[Mapping[str, Any]] | Breakpoints | None

The style of the component.

None
key Any | None

A unique key for the component.

None
id Any | None

The id for the component.

None
ref Var | None

The Var to pass as the ref to the component.

None
class_name Any | None

The class name for the component.

None
custom_attrs dict[str, Var | Any] | None

custom attribute

None
**props

The props of the component.

{}

Returns:

Type Description
RedirectToOrganizationProfile

The component.

RedirectToCreateOrganization

Bases: ClerkBase

Source code in custom_components/reflex_clerk_api/control_components.py
70
71
class RedirectToCreateOrganization(ClerkBase):
    tag = "RedirectToCreateOrganization"

create(*children, style=None, key=None, id=None, ref=None, class_name=None, custom_attrs=None, on_blur=None, on_click=None, on_context_menu=None, on_double_click=None, on_focus=None, on_mount=None, on_mouse_down=None, on_mouse_enter=None, on_mouse_leave=None, on_mouse_move=None, on_mouse_out=None, on_mouse_over=None, on_mouse_up=None, on_scroll=None, on_scroll_end=None, on_unmount=None, **props) classmethod

Create the component.

Parameters:

Name Type Description Default
*children

The children of the component.

()
style Sequence[Mapping[str, Any]] | Mapping[str, Any] | Var[Mapping[str, Any]] | Breakpoints | None

The style of the component.

None
key Any | None

A unique key for the component.

None
id Any | None

The id for the component.

None
ref Var | None

The Var to pass as the ref to the component.

None
class_name Any | None

The class name for the component.

None
custom_attrs dict[str, Var | Any] | None

custom attribute

None
**props

The props of the component.

{}

Returns:

Type Description
RedirectToCreateOrganization

The component.

SignedIn

Bases: ClerkBase

Only renders children when the user is signed in.

Source code in custom_components/reflex_clerk_api/control_components.py
74
75
76
77
class SignedIn(ClerkBase):
    """Only renders children when the user is signed in."""

    tag = "SignedIn"

create(*children, style=None, key=None, id=None, ref=None, class_name=None, custom_attrs=None, on_blur=None, on_click=None, on_context_menu=None, on_double_click=None, on_focus=None, on_mount=None, on_mouse_down=None, on_mouse_enter=None, on_mouse_leave=None, on_mouse_move=None, on_mouse_out=None, on_mouse_over=None, on_mouse_up=None, on_scroll=None, on_scroll_end=None, on_unmount=None, **props) classmethod

Create the component.

Parameters:

Name Type Description Default
*children

The children of the component.

()
style Sequence[Mapping[str, Any]] | Mapping[str, Any] | Var[Mapping[str, Any]] | Breakpoints | None

The style of the component.

None
key Any | None

A unique key for the component.

None
id Any | None

The id for the component.

None
ref Var | None

The Var to pass as the ref to the component.

None
class_name Any | None

The class name for the component.

None
custom_attrs dict[str, Var | Any] | None

custom attribute

None
**props

The props of the component.

{}

Returns:

Type Description
SignedIn

The component.

SignedOut

Bases: ClerkBase

Only renders children when the user is signed out.

Source code in custom_components/reflex_clerk_api/control_components.py
80
81
82
83
class SignedOut(ClerkBase):
    """Only renders children when the user is signed out."""

    tag = "SignedOut"

create(*children, style=None, key=None, id=None, ref=None, class_name=None, custom_attrs=None, on_blur=None, on_click=None, on_context_menu=None, on_double_click=None, on_focus=None, on_mount=None, on_mouse_down=None, on_mouse_enter=None, on_mouse_leave=None, on_mouse_move=None, on_mouse_out=None, on_mouse_over=None, on_mouse_up=None, on_scroll=None, on_scroll_end=None, on_unmount=None, **props) classmethod

Create the component.

Parameters:

Name Type Description Default
*children

The children of the component.

()
style Sequence[Mapping[str, Any]] | Mapping[str, Any] | Var[Mapping[str, Any]] | Breakpoints | None

The style of the component.

None
key Any | None

A unique key for the component.

None
id Any | None

The id for the component.

None
ref Var | None

The Var to pass as the ref to the component.

None
class_name Any | None

The class name for the component.

None
custom_attrs dict[str, Var | Any] | None

custom attribute

None
**props

The props of the component.

{}

Returns:

Type Description
SignedOut

The component.