Choose an account
AuthenticationThe accounts this device knows. Pick one and type only the password.
Installation
npx nook-ui@latest add login-accountsThe block is copied to components/blocks/login-accounts.tsx, together with the components it uses.
Prompt
Paste this into your AI coding assistant. It adds this exact block with the components it uses, and tells the assistant how to wire it up.
Short. For assistants that can run commands in your project.
Add the Nook "Choose an account" block (authentication) to this project, exactly as Nook ships it.
The accounts this device knows. Pick one and type only the password.
Steps
1. Check for `nook.json` in the project root. If it is missing, run `npx nook-ui@latest init` first (React or Next.js with Tailwind CSS v4). It adds the Nook tokens, the theme and `cn()`.
2. Run `npx nook-ui@latest add login-accounts`. It writes `components/blocks/login-accounts.tsx` together with the Nook components the block uses. Do not write the block from memory.
3. If you cannot run commands, fetch http://localhost:3000/r/login-accounts.json, write every entry of `files` to the path it names, install the packages in `dependencies`, and repeat for each name in `registryDependencies`.
4. Render it on the page I ask for:
```tsx
import { LoginAccounts } from "@/components/blocks/login-accounts";
export default function Page() {
return <LoginAccounts />;
}
```
Rules
- Colors, radii, shadows and motion come from Nook tokens and classes such as `bg-primary`, `text-muted-foreground`, `border-border`, `rounded-lg` and `h-control`. Never hard-code them.
- Do not restyle or simplify the file. Change how it looks through `className`, its props and the theme.
- It must keep working with the keyboard, in light and dark mode, and in the sharp, soft and bold styles.
- The block draws the screen and checks the fields. It never talks to a server: pass what should happen through its props (`onSubmit`, `onSave` and so on) and replace the default content with real data through props.
- A full page block fills its parent, so give the parent a height (for example `min-h-dvh`).
Done when the page renders the block as in the Nook block library in light and dark mode, at phone width too, and the project type-checks.