Skip to main content

OrganizationListView

The OrganizationListView renders a standalone account picker for choosing between the user's Personal Account and Organization accounts.

The OrganizationListView renders a standalone account picker for choosing between the user's and Organization accounts. It lists the Personal Account when allowed, Organization memberships, pending Organization invitations, suggested Organizations, and a Create organization action for users who can create Organizations.

Personal Account selection clears the . Organization selection sets the selected Organization as active.

Parameters

  • Name
    modifier
    Type
    Modifier
    Description

    A modifier that gets applied to OrganizationListView.

  • Name
    clerkTheme
    Type
    ClerkTheme?
    Description

    The theme to apply to the OrganizationListView.

  • Name
    hidePersonalAccount
    Type
    Boolean
    Description

    Whether the option should be hidden even when the option is allowed. Defaults to false.

  • Name
    isDismissable
    Type
    Boolean
    Description

    Whether the view can be dismissed by the user. When true, a dismiss button appears and the view closes automatically after account selection. When false, no dismiss button is shown. Defaults to true.

  • Name
    skipPostCreateInviteFlow
    Type
    Boolean
    Description

    Reserved for create Organization flows that include a post-create invitation step. Android's current flow already stops after creation. Defaults to false.

  • Name
    onDismissRequest
    Type
    (() -> Unit)?
    Description

    Called when the dismiss affordance is pressed or when a dismissable selection completes.

  • Name
    onCreateOrganization
    Type
    ((OrganizationCreationDefaults?) -> Unit)?
    Description

    Called when the user selects the Create Organization action. The latest creation defaults are provided when available.

  • Name
    onAccountSelected
    Type
    ((String?) -> Unit)?
    Description

    Called after selecting the or an Organization. Receives null for Personal Account selection and the Organization ID for Organization selection.

Usage

The following examples show how to use the OrganizationListView in your app.

Fullscreen account picker

import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.clerk.ui.organizationlist.OrganizationListView

@Composable
fun AccountPickerScreen(onDone: () -> Unit) {
    OrganizationListView(
        modifier = Modifier.fillMaxSize(),
        onDismissRequest = onDone,
        onAccountSelected = { selectedOrganizationId ->
            // selectedOrganizationId is null when the user selects their Personal Account.
            onDone()
        },
    )
}
import com.clerk.api.organizations.OrganizationCreationDefaults
import com.clerk.ui.organizationlist.OrganizationListView

OrganizationListView(
    onCreateOrganization = { creationDefaults: OrganizationCreationDefaults? ->
        // Navigate to your own create Organization flow.
    },
)
OrganizationListView(
    hidePersonalAccount = true,
    onAccountSelected = { organizationId ->
        // organizationId is non-null when Personal Account option is hidden.
    },
)

Feedback

What did you think of this content?

Last updated on