OrganizationListView

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. Whenfalse, no dismiss button is shown. Defaults totrue.
- 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
nullfor 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
Last updated on