shadcn.io is not affiliated with official shadcn/ui
Workspace Picker Login Block for React
A 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.
Installation
Overview
Route people to the right workspace before the password, with this workspace picker login block for React with Base UI. It's the sign-in page of Pagewell, a team wiki: the page's side rails run the full height of the screen and one band crosses it between two rules. Three remembered workspaces sit as tiles on hairlines in a two-by-two frame, each with its initials, name, member count and when it was last used, and the fourth cell is Add another workspace. Choosing a tile selects it, dims the others and fills the space under the grid with its password field, so nothing swaps screens. Forget on a tile takes it off the list, a status line says so and a permanent Undo puts the last one back; the grid keeps its size with blank cells and shows an Empty state when none are left. Add another workspace opens an address field in the same space. The one Shine Button names the next step: Choose a workspace, Sign in to Gull Row, or Add workspace. It's built from Empty, Field, Input Group, Password Input, Button, Shine Button and Guides, with native radio inputs and a CSS entrance only. For multi-workspace products that remember where you have been.
FAQ
What stays in the page, and how do I wire it for real?
Everything. The three workspaces, their member counts and last-used days are typed, any password is accepted and nothing is sent or stored; forgetting only changes the page's state. In a product, keep the list in a first-party cookie or local storage on the device, forget by removing the entry there, and send the password to the chosen workspace's own sign-in endpoint.
How do Forget and Undo work?
Forget takes the tile off the list and the status line says so ("Forgot Heron Court. 2 workspaces remembered."); focus moves to the next tile. Undo is always on the page, quiet until there is something to undo, and puts the last forgotten workspace back in its old place, as many times as you forgot. There is no toast that disappears: the line and the button stay.
What happens when every workspace is forgotten?
The grid keeps its height, so the page doesn't jump: an empty state takes the place of the tiles, says Undo brings the last one back and offers Add a workspace. The cell for adding another stays where it was.
How does adding a workspace work?
Add another workspace selects the add cell and opens the address field, with the address's own start and end around it (https:// and .pagewell.example). It accepts three or more letters, numbers or hyphens, refuses a duplicate, and holds three at most: with a full list it says to forget one first. A good address adds a tile, selects it and moves focus to its password.
Why is the button quiet before a choice, and not disabled?
A disabled button explains nothing and is skipped by the keyboard. Here it stays pressable: with nothing chosen it says "Choose a workspace first." and moves focus to the first tile; with a tile chosen its label names the workspace, and a press with no password names the missing field and focuses it.
How does it look on a phone?
The tiles stay two across, and the button is pinned to the foot of the screen so it is always in reach while the grid and the password field scroll. Texts that only repeat what the tiles say, such as the address under the password line, are kept for screen readers on a phone.
Related
- Pro
Recent Accounts Login
Account choosersAn account chooser: three recent accounts as hairline rows with initials and a session state, Remove with a permanent Undo, and a password, a plain Continue or an email and password pair under the list.
- Pro
Tenant Select Login
Workspaces and rolesThe 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.
- 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
Enterprise SSO Login
SSO and providersA sign-in page for a construction project manager that asks for the workspace address first: it looks the workspace up as you type, offers the right spelling for a typo and turns the button into Continue with SSO.
- Pro
Profile Switch Login
Account choosersA who is watching page: four profile tiles with initials and a lock, an Add profile tile, an Edit mode that turns names into fields and shows Remove with a permanent Undo, and a four-digit PIN for the locked profile.
- 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.