shadcn.io is not affiliated with official shadcn/ui
Connected Accounts Settings Block for React
A profile fields table where each field picks its source (by hand, Google, GitHub or Strava), and the accounts below it, which can't be disconnected while they still supply a field.
Installation
Overview
Show people where their profile comes from before they disconnect anything, with this connected accounts block for React with Base UI. A native table lists four profile fields (name, avatar, email, bio). Each has a row of radio chips for its source: By hand, or an account that is connected and can supply it. A source that can't be picked is struck through and says why to a screen reader ("Strava (not connected)"). What the profile reads as is in the last column, with the avatar drawn as initials. Under it the accounts (Google, GitHub, Strava) each have a two-letter lettermark tile, the day it was connected and a line saying which fields it supplies. An account that supplies a field can't be disconnected: its Button is quiet, reads "GitHub supplies your bio. Pick a new source first." and a press moves focus to that field's source. One that supplies nothing is disconnected through an Alert Dialog that opens on Keep connected, with a destructive action. Choices apply at once, so there is no Save, and Reset sources puts the starting choices back. It's built from Alert Dialog, Button and Guides, with native radios and a CSS entrance only. For a profile page, a developer portal or any product that fills a profile from linked accounts.
FAQ
How do I add an account or a field?
Add an account to PROVIDERS with its two-letter mark, its handle and gives, the fields it can supply and the value each would show, and a field to FIELDS with the value it shows when entered by hand. The radio chips, the results column and the account lines all read from those lists. START_PICKS and START_LINKS set which source each field has and which accounts are connected when the page opens.
How does the disconnect guard work?
An account can be disconnected only when no field uses it as its source. While one does, the Disconnect button is quiet but still answers: the line above it names what it supplies, a press repeats that in the status line and focus moves to the checked source of the first field that depends on it, ready to be changed. Pick another source for every field it supplies and the button becomes the real Disconnect, which asks first.
What stays local, and how do I make it real?
Everything. Connect adds a row with a fixed date and opens nothing at the service, Disconnect removes it, and the typed values stand in for what each service would return; a reload brings back the starting state. To make it real, start your OAuth flow from Connect, store the account and the scopes granted, read the profile values from it on your server and revoke the token when someone disconnects.
What does the alert dialog do?
It confirms a disconnect that can't hurt a field. It opens with focus on Keep connected, Escape and Cancel close it and return focus to the button that opened it, and it can't be dismissed by clicking outside it. The destructive action disconnects the account, and focus then goes to that row's Connect button, which replaced it.
Are the service names and marks real?
The names are real services named in text, as any integration page does, and the tiles are two typed letters in a neutral square, not logos. Each tile has a code comment where you can drop in a logo you have the right to use. The handles, dates and profile values are invented.
How does it look on a phone, and by keyboard?
Each field becomes a card with its radio chips wrapping under its name and what it shows underneath; each account is a row with its button under the text. The source chips are native radios, so arrow keys move between the ones you can pick and a struck-through one is skipped. The status line is a polite live region present from the start and reads every change.
Related
- Pro
Connected Accounts Account
Connected appsThe sign-in providers linked to an account: each with its address, link date and use history, an Unlink that asks first and refuses on the only way in, an Undo line and quiet buttons to link more.
- Pro
Login Providers Account
Sign-in methodsGo passwordless safely: the sign-in methods ranked by strength as a ladder, the four things that must hold first, and one button that turns the password off only when they all do.
- Pro
Social Links Settings
Fields and formsA social links editor with five places for links: each address is recognised and checked against its service's shape, shown or hidden, moved and removed, with Add by pasting, a preview of the links on the page and an Undo.
- Pro
A connected apps settings panel with a permission review sheet: each app asks for permissions shown as switches with what they allow, a pause, and a disconnect that confirms first.
- Pro
Profile Settings
Privacy and consentA profile visibility page: five parts of a profile, each with a menu for who sees it (Everyone, Workspace, Only me), beside a drawn profile card with a Preview as choice (Public, Teammate, Me) that hides what that viewer cannot see.
- Pro
Custom Fields Settings
Fields and formsAn Add field sheet open over a drawn Contacts table: a name, a type picked from six cards, the options that belong to that type, a live preview of the field, and an Add that appends a column to the table behind it.