shadcn.io is not affiliated with official shadcn/ui
Tenant Select Login Block for React
The workspace chooser shown after sign-in: a signed-in line, a filter, a native table of four workspaces sortable by name or last used, a star that sets the default and one button that opens the chosen one.
Installation
Overview
Let a signed-in person choose where to go, with this tenant select login block for React with Base UI. It's the workspace chooser of Clientloft, an agency CRM, shown as a compact header over one framed panel. The first band says who is signed in and offers Sign out; the toolbar filters the four workspaces by what their name, address or role holds and counts "Showing 2 of 4"; the table is native, one radio row per workspace with its name and address, your role in an outline Badge, the member count, the day you last opened it and a star that makes it your default. The Workspace and Last used heads sort the rows and say how in a polite line. Nothing changes the table's height: a filter that matches nothing shows an Empty state in the same frame, and Create workspace is a ghost row at its foot. Pressing Enter on a row, or the one Shine Button, opens the chosen workspace. It's built from Empty, Badge, Input, Button, Shine Button and Guides, with a native table and a CSS entrance only. For multi-tenant apps that ask which workspace after the password.
FAQ
What stays in the page, and how do I wire it for real?
Everything. The four workspaces, your roles, member counts and last-used days are typed, the default star only changes the page's state and opening a workspace waits 700 milliseconds and says "Opened" without going anywhere. In a product, list the account's memberships from your server, store the default on the account and start a session in the chosen workspace on open.
How does the sorting work?
The Workspace and Last used heads are buttons. A first press sorts in the order that column starts with (names A to Z, last used newest first), a second press reverses it and a third puts the rows back in their listed order; the active head carries aria-sort and a polite line reads the result. Ties fall to the workspace name, so a tie never reshuffles.
How does the filter work, and what is read out?
It matches the text of the name, address and role, ignoring case and accents, so mill finds Cobalt Mill and guest finds the workspace where you are a Guest. The count beside the field updates at once; a polite line reads it about half a second after the last keystroke ("2 of 4 match."), never once per letter. A filter with no match shows a short message and a button to clear it, and the frame keeps its height.
What does the star do?
It makes that workspace the one that opens first next time. Exactly one workspace is the default, so pressing the star of the current default just says it already is. The star is a toggle button named "Default workspace, Cobalt Mill" and pressed for the default; it is a filled star against an outline one, not a color.
Related
- Pro
Workspace Picker Login
Workspaces and rolesA sign-in page that starts from the workspaces this browser remembers: tiles on hairlines with an add cell, a password field that fills the space under the grid, and Forget with a permanent Undo.
- Pro
Linked Workspaces Account
OrganizationsThe workspaces in an account as one ruled list: current and default marks, Open, a menu with Make default and Leave (which asks first), a dialog to create one, a field to join with a code, and Undo.
- Pro
Organization Select Login
SSO and providersA sign-in page that starts from the organisation: a combobox over six companies narrows as you type, and the one you pick sets the form below it, single sign-on only, password and code, or password alone.
- Pro
Role Select Login
Workspaces and rolesA role chooser after sign-in: three radio rows (Admin, Editor, Viewer) beside a capability matrix whose cells say Can or Cannot in words, re-read as you pick, and one button that continues as the chosen role.
- Pro
Sortable Members Table
Sort and searchA members table whose column heads are buttons: press one to sort, again to reverse, a third time for the original order, with aria-sort on the active head, ties settled by name and a spoken line for each result.
- Pro
Team Invite Acceptance Login
Workspaces and rolesAn invitation page for a shared team calendar: the workspace tile, Maya invited you to Hollin Row Studio, the Editor role and three members as initials with 9 more beside a form with the invited address locked, a name and a new password, or just the password for an existing account.