Stack Auth
GuidesSDKComponents
API Reference
Components Overview
Authentication
<SignIn /><SignUp /><CredentialSignIn /><CredentialSignUp /><MagicLinkSignIn /><ForgotPassword /><PasswordReset />
OAuth
<OAuthButton /><OAuthButtonGroup />
User Interface
<UserButton /><AccountSettings /><SelectedTeamSwitcher />
Layout & Providers
<StackProvider /><StackHandler /><StackTheme />
Stack Auth Docs

<SelectedTeamSwitcher />

Component Options

If true, prevents the component from updating the user's selected team when a team is chosen.

Function that maps a team to a URL. When provided, selecting a team will navigate to the mapped URL.

Different scenarios to demonstrate various states of the team switcher.

Live Preview

Component Demo

For a comprehensive guide on using this component, refer to our Team Selection documentation.

Props

PropTypeDefaultDescription
urlMapoptional
function—A function that maps a team to a URL. If provided, the component will navigate to this URL when a team is selected.
selectedTeamoptional
Team—The initially selected team.
noUpdateSelectedTeamoptional
booleanfalseIf true, prevents updating the selected team in the user's settings when a new team is selected.

Example

import { SelectedTeamSwitcher } from '@stackframe/stack';

export default function Page() {
  return (
    <div>
      <h1>Team Switcher</h1>
      <SelectedTeamSwitcher
        urlMap={(team) => `/team/${team.id}`}
        selectedTeam={currentTeam}
        noUpdateSelectedTeam={false}
      />
    </div>
  );
}
Previous Page<AccountSettings />
Next Page<StackProvider />

On this page

PropsExample

Stack Auth AI

Experimental: AI responses may not always be accurate—please verify important details.

For the most accurate information, please join our Discord or email us.

How can I help?

Ask me about Stack Auth while you browse the docs.