Skip to content

User components

Stub file for reflex_clerk_api/user_components.py

UserButton

Bases: ClerkBase

The full URL or path to navigate to after a successful account change in a multi-session app.

Source code in custom_components/reflex_clerk_api/user_components.py
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class UserButton(ClerkBase):
    tag = "UserButton"

    after_switch_session_url: str | None = None
    "The full URL or path to navigate to after a successful account change in a multi-session app."

    # NOTE: `apperance.base_theme` does not work yet.
    appearance: Appearance | None = None
    """Optional object to style your components. Will only affect Clerk components."""

    default_open: bool | None = None
    "Controls whether the <UserButton /> should open by default during the first render."

    show_name: bool | None = None
    "Controls if the user name is displayed next to the user image button."

    sign_in_url: str | None = None
    "The full URL or path to navigate to when the Add another account button is clicked. It's recommended to use the environment variable instead."

    user_profile_mode: str | None = None
    "Controls whether selecting the Manage your account button will cause the <UserProfile /> component to open as a modal, or if the browser will navigate to the userProfileUrl where <UserProfile /> is mounted as a page. Defaults to: 'modal'."

    user_profile_props: dict | None = None
    "Specify options for the underlying <UserProfile /> component. For example: {additionalOAuthScopes: {google: ['foo', 'bar'], github: ['qux']}}."

    user_profile_url: str | None = None
    "The full URL or path leading to the user management interface."

    fallback: rx.Component | None = None
    "An optional element to be rendered while the component is mounting."

after_switch_session_url = None class-attribute instance-attribute

The full URL or path to navigate to after a successful account change in a multi-session app.

appearance = None class-attribute instance-attribute

Optional object to style your components. Will only affect Clerk components.

default_open = None class-attribute instance-attribute

Controls whether the should open by default during the first render.

show_name = None class-attribute instance-attribute

Controls if the user name is displayed next to the user image button.

sign_in_url = None class-attribute instance-attribute

The full URL or path to navigate to when the Add another account button is clicked. It's recommended to use the environment variable instead.

user_profile_mode = None class-attribute instance-attribute

Controls whether selecting the Manage your account button will cause the component to open as a modal, or if the browser will navigate to the userProfileUrl where is mounted as a page. Defaults to: 'modal'.

user_profile_props = None class-attribute instance-attribute

Specify options for the underlying component. For example: {additionalOAuthScopes: {google: ['foo', 'bar'], github: ['qux']}}.

user_profile_url = None class-attribute instance-attribute

The full URL or path leading to the user management interface.

fallback = None class-attribute instance-attribute

An optional element to be rendered while the component is mounting.

create(*children, after_switch_session_url=None, appearance=None, default_open=None, show_name=None, sign_in_url=None, user_profile_mode=None, user_profile_props=None, user_profile_url=None, fallback=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.

()
appearance Appearance | None

NOTE: apperance.base_theme does not work yet.

None
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
UserButton

The component.

Source code in custom_components/reflex_clerk_api/user_components.py
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
    fallback: rx.Component | None = None
    "An optional element to be rendered while the component is mounting."


class UserProfile(ClerkBase):
    tag = "UserProfile"

    appearance: Appearance | None = None
    """Optional object to style your components. Will only affect Clerk components."""

    routing: str | None = None
    "The routing strategy for your pages. Defaults to 'path' for frameworks that handle routing, such as Next.js and Remix. Defaults to hash for all other SDK's, such as React."

    path: str | None = None
    "The path where the component is mounted on when routing is set to path. It is ignored in hash-based routing. For example: /user-profile."

    additional_oauth_scopes: dict | None = None
    "Specify additional scopes per OAuth provider that your users would like to provide if not already approved. For example: {google: ['foo', 'bar'], github: ['qux']}."

    fallback: rx.Component | None = None
    "An optional element to be rendered while the component is mounting."


user_button = UserButton.create
user_profile = UserProfile.create

UserProfile

Bases: ClerkBase

Optional object to style your components. Will only affect Clerk components.

Source code in custom_components/reflex_clerk_api/user_components.py
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
class UserProfile(ClerkBase):
    tag = "UserProfile"

    appearance: Appearance | None = None
    """Optional object to style your components. Will only affect Clerk components."""

    routing: str | None = None
    "The routing strategy for your pages. Defaults to 'path' for frameworks that handle routing, such as Next.js and Remix. Defaults to hash for all other SDK's, such as React."

    path: str | None = None
    "The path where the component is mounted on when routing is set to path. It is ignored in hash-based routing. For example: /user-profile."

    additional_oauth_scopes: dict | None = None
    "Specify additional scopes per OAuth provider that your users would like to provide if not already approved. For example: {google: ['foo', 'bar'], github: ['qux']}."

    fallback: rx.Component | None = None
    "An optional element to be rendered while the component is mounting."

appearance = None class-attribute instance-attribute

Optional object to style your components. Will only affect Clerk components.

routing = None class-attribute instance-attribute

The routing strategy for your pages. Defaults to 'path' for frameworks that handle routing, such as Next.js and Remix. Defaults to hash for all other SDK's, such as React.

path = None class-attribute instance-attribute

The path where the component is mounted on when routing is set to path. It is ignored in hash-based routing. For example: /user-profile.

additional_oauth_scopes = None class-attribute instance-attribute

Specify additional scopes per OAuth provider that your users would like to provide if not already approved. For example: {google: ['foo', 'bar'], github: ['qux']}.

fallback = None class-attribute instance-attribute

An optional element to be rendered while the component is mounting.

create(*children, appearance=None, routing=None, path=None, additional_oauth_scopes=None, fallback=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
UserProfile

The component.