Skip to content

Control Components

reflex_clerk.signed_in

signed_in(*children)

The component renders its children only if there's a User with an active Session signed in your application.

Parameters:

Name Type Description Default
*children Component

Zero or more child components that will be rendered inside the SignedIn component.

()

Returns:

Type Description
SignedIn

A SignedIn component instance that can be rendered.

Source code in custom_components/reflex_clerk/lib/control.py
307
308
309
310
311
312
313
314
315
316
317
def signed_in(*children: rx.Component) -> SignedIn:
    """
    The <SignedIn> component renders its children only if there's a User with an active Session signed in your application.

    Args:
        *children: Zero or more child components that will be rendered inside the SignedIn component.

    Returns:
        A SignedIn component instance that can be rendered.
    """
    return SignedIn.create(*children)

reflex_clerk.signed_out

signed_out(*children)

The component renders its children only if there's no User with an active Session signed in your application.

Parameters:

Name Type Description Default
*children Component

Zero or more child components that will be rendered inside the SignedOut component.

()

Returns:

Type Description
SignedOut

A SignedOut component instance that can be rendered.

Source code in custom_components/reflex_clerk/lib/control.py
320
321
322
323
324
325
326
327
328
329
330
def signed_out(*children: rx.Component) -> SignedOut:
    """
    The <SignedOut> component renders its children only if there's no User with an active Session signed in your application.

    Args:
        *children: Zero or more child components that will be rendered inside the SignedOut component.

    Returns:
        A SignedOut component instance that can be rendered.
    """
    return SignedOut.create(*children)

reflex_clerk.redirect_to_sign_in

redirect_to_sign_in()

The component navigates to the sign-in URL configured in your application instance.

Returns:

Type Description
RedirectToSignIn

A RedirectToSignIn component instance that can be rendered.

Source code in custom_components/reflex_clerk/lib/control.py
254
255
256
257
258
259
260
261
def redirect_to_sign_in() -> RedirectToSignIn:
    """
    The <RedirectToSignIn /> component navigates to the sign-in URL configured in your application instance.

    Returns:
        A RedirectToSignIn component instance that can be rendered.
    """
    return RedirectToSignIn.create()

reflex_clerk.redirect_to_sign_up

redirect_to_sign_up()

The component navigates to the sign-up URL configured in your application instance.

Returns:

Type Description
RedirectToSignUp

A RedirectToSignUp component instance that can be rendered.

Source code in custom_components/reflex_clerk/lib/control.py
264
265
266
267
268
269
270
271
def redirect_to_sign_up() -> RedirectToSignUp:
    """
    The <RedirectToSignUp /> component navigates to the sign-up URL configured in your application instance.

    Returns:
        A RedirectToSignUp component instance that can be rendered.
    """
    return RedirectToSignUp.create()

reflex_clerk.redirect_to_user_profile

redirect_to_user_profile()

The component navigates to the user profile URL configured in your application instance.

Returns:

Type Description
RedirectToUserProfile

A RedirectToUserProfile component instance that can be rendered.

Source code in custom_components/reflex_clerk/lib/control.py
274
275
276
277
278
279
280
281
def redirect_to_user_profile() -> RedirectToUserProfile:
    """
    The <RedirectToUserProfile /> component navigates to the user profile URL configured in your application instance.

    Returns:
        A RedirectToUserProfile component instance that can be rendered.
    """
    return RedirectToUserProfile.create()

reflex_clerk.redirect_to_organization_profile

redirect_to_organization_profile()

The component navigates to the organization profile URL configured in your application instance.

Returns:

Type Description
RedirectToOrganizationProfile

A RedirectToOrganizationProfile component instance that can be rendered.

Source code in custom_components/reflex_clerk/lib/control.py
284
285
286
287
288
289
290
291
def redirect_to_organization_profile() -> RedirectToOrganizationProfile:
    """
    The <RedirectToOrganizationProfile /> component navigates to the organization profile URL configured in your application instance.

    Returns:
        A RedirectToOrganizationProfile component instance that can be rendered.
    """
    return RedirectToOrganizationProfile.create()

reflex_clerk.redirect_to_create_organization

redirect_to_create_organization(*children)

The component navigates to the create organization URL configured in your application instance.

Parameters:

Name Type Description Default
*children Component

Zero or more child components that will be rendered inside the RedirectToCreateOrganization component.

()

Returns:

Type Description
RedirectToCreateOrganization

A RedirectToCreateOrganization component instance that can be rendered.

Source code in custom_components/reflex_clerk/lib/control.py
294
295
296
297
298
299
300
301
302
303
304
def redirect_to_create_organization(*children: rx.Component) -> RedirectToCreateOrganization:
    """
    The <RedirectToCreateOrganization /> component navigates to the create organization URL configured in your application instance.

    Args:
        *children: Zero or more child components that will be rendered inside the RedirectToCreateOrganization component.

    Returns:
        A RedirectToCreateOrganization component instance that can be rendered.
    """
    return RedirectToCreateOrganization.create(*children)

reflex_clerk.multisession_app_support

multisession_app_support(*children)

The provides a wrapper for your React application that guarantees a full rerendering cycle everytime the current session and user changes.

Parameters:

Name Type Description Default
*children Component

Zero or more child components that will be rendered inside the MultisessionAppSupport component.

()

Returns:

Type Description
MultisessionAppSupport

A MultisessionAppSupport component instance that can be rendered.

Source code in custom_components/reflex_clerk/lib/control.py
241
242
243
244
245
246
247
248
249
250
251
def multisession_app_support(*children: rx.Component) -> MultisessionAppSupport:
    """
    The <MultisessionAppSupport> provides a wrapper for your React application that guarantees a full rerendering cycle everytime the current session and user changes.

    Args:
        *children: Zero or more child components that will be rendered inside the MultisessionAppSupport component.

    Returns:
        A MultisessionAppSupport component instance that can be rendered.
    """
    return MultisessionAppSupport.create(*children)

reflex_clerk.clerk_loading

clerk_loading(*children)

The component indicates that Clerk is still loading.

Parameters:

Name Type Description Default
*children Component

Zero or more child components that will be rendered inside the ClerkLoading component.

()

Returns:

Type Description
ClerkLoading

A ClerkLoading component instance that can be rendered.

Source code in custom_components/reflex_clerk/lib/control.py
199
200
201
202
203
204
205
206
207
208
209
def clerk_loading(*children: rx.Component) -> ClerkLoading:
    """
    The <ClerkLoading> component indicates that Clerk is still loading.

    Args:
        *children: Zero or more child components that will be rendered inside the ClerkLoading component.

    Returns:
        A ClerkLoading component instance that can be rendered.
    """
    return ClerkLoading.create(*children)

reflex_clerk.clerk_loaded

clerk_loaded(*children)

The component indicates that Clerk is fully loaded.

Parameters:

Name Type Description Default
*children Component

Zero or more child components that will be rendered inside the ClerkLoaded component.

()

Returns:

Type Description
ClerkLoaded

A ClerkLoaded component instance that can be rendered.

Source code in custom_components/reflex_clerk/lib/control.py
186
187
188
189
190
191
192
193
194
195
196
def clerk_loaded(*children: rx.Component) -> ClerkLoaded:
    """
    The <ClerkLoaded> component indicates that Clerk is fully loaded.

    Args:
        *children: Zero or more child components that will be rendered inside the ClerkLoaded component.

    Returns:
        A ClerkLoaded component instance that can be rendered.
    """
    return ClerkLoaded.create(*children)

reflex_clerk.protect

protect(
    *children,
    condition=None,
    fallback=None,
    permission=None,
    role=None
)

The component conditionally renders its children based on the provided logic.

Parameters:

Name Type Description Default
*children Component

Zero or more child components that will be rendered inside the Protect component.

()
condition Javascript

Optional conditional logic that renders the children if it returns true.

None
fallback Union[Component, str]

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

None
permission str

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

None
role str

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

None

Returns:

Type Description
Protect

A Protect component instance that can be rendered.

Source code in custom_components/reflex_clerk/lib/control.py
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
def protect(
        *children: rx.Component,
        condition: Javascript = None,
        fallback: typing.Union[rx.Component, str] = None,
        permission: str = None,
        role: str = None
) -> Protect:
    """
    The <Protect> component conditionally renders its children based on the provided logic.

    Args:
        *children: Zero or more child components that will be rendered inside the Protect component.
        condition: Optional conditional logic that renders the children if it returns true.
        fallback: An optional snippet of JSX to show when a user doesn't have the role or permission to access the protected content.
        permission: Optional string corresponding to a Role's Permission in the format org:<resource>:<action>.
        role: Optional string corresponding to an Organization's Role in the format org:<role>.

    Returns:
        A Protect component instance that can be rendered.
    """
    return Protect.create(
        *children,
        condition=condition,
        fallback=fallback,
        permission=permission,
        role=role
    )