Staaarter

Account Chooser

A full-height account picker screen: a list of saved accounts, each showing an avatar with an initials fallback, a name, and an email, followed by a Use another account row with a plus icon. A static, server-rendered block with no client-side state.

By Staaarter Team
Auth
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, avatar, avatar-initials dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/account-chooser.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/auth/auth7.tsx instead.

Usage

The file also exports auth7Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Auth7, auth7Demo } from "@/components/blocks/auth/auth7";

export default function Page() {
  return <Auth7 {...auth7Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Choose an account"Screen heading.
descriptionstring"Select an account to continue signing in."Short description shown under the heading.
accountsSavedAccount[]noneSaved accounts rendered as rows, in the order passed in.
addAccountLabelstring"Use another account"Label on the bottom row.
addAccountHrefstring"#"Link target for the Use another account row.
classNamestringnoneExtra classes for the outer section element.

Types

type SavedAccount = {
  name: string;
  email: string;
  avatar?: { src: string; alt: string };
  href?: string;
};

Behavior notes

  • Each account row and the Use another account row render as real Next.js Link components via the button's render prop, but none of them navigate anywhere real by default (href defaults to "#").
  • Avatars fall back to initials generated from the account's name whenever avatar.src is missing or fails to load, using the shared Avatar/AvatarFallback components.
  • This block is a plain server component: rows are styled to look clickable and hoverable, but clicking one does not actually sign in as that account.