# Create account

Create your company's account. You become its owner; what that means is the app's to say (`ownerNote`), before you commit. One person belongs to one account, so if invites are waiting for you, creating an account supersedes them — that's said here, before it happens.

- Registry name: `account-create` (`@candor/account-create`)
- Tier: Pro. Installing it needs a Pro, Premium or Team licence key: the person runs `npx candor-ui key <key>` themselves; never ask for the key in chat or write it to a file.
- Docs: https://candor.themethodic.com/docs/account-create

## Install

```bash
npx candor-ui add account-create
```

Run `npx candor-ui@latest init` once first (https://candor.themethodic.com/get-started.md). Without the CLI: `npx shadcn@latest add @candor/account-create`.
It brings in: button, input, locale, locked, utils.
npm packages: lucide-react@^1.67.0.

## Example

```tsx
"use client"

import * as React from "react"
import { AccountCreate } from "@/components/account-create"

export default function Example() {
  const [busy, setBusy] = React.useState(false)
  return (
    <AccountCreate
      email="priya@acme.example"
      verified
      pendingInvites={1}
      ownerNote="Admin on every environment, and the only person who can remove members."
      busy={busy}
      onCreate={async () => {
        setBusy(true)
        await new Promise((r) => setTimeout(r, 600))
        setBusy(false)
      }}
      onSeeInvites={() => {}}
    />
  )
}
```

## <AccountCreate>

Props:

- `email: string`: The signed-in person's email, shown at the top.
- `verified: boolean`: Whether that email is verified; until it is, Create is locked with the reason.
- `pendingInvites?: number | undefined` (default `0`): How many invites are waiting for this person; above 0, says creating an account supersedes them. Defaults to 0.
- `ownerNote?: React.ReactNode | undefined`: What being the owner means here, e.g. "Admin everywhere; ownership can’t be handed over yet."
- `onCreate: (name: string) => void`: Called on submit with the trimmed company name.
- `onSeeInvites?: (() => void) | undefined`: Shows a link to the waiting invites; called when it's clicked.
- `busy?: boolean | undefined` (default `false`): Disables Create while the account is being made.
- `error?: string | undefined`: Shown under the name field, e.g. when the name is taken.
- `className?: string | undefined`

## Strings (`accountCreate`)

The fixed words, English by default. Override any of them under `accountCreate` in `<LocaleProvider strings={{ accountCreate: { … } }}>`; the table is exported as `accountCreateStrings`.

- `heading`: Create your company’s account
- `verified`: verified
- `notVerified`: not verified
- `verifyFirst`: Verify your email first; accounts are tied to a verified address.
- `nameIt`: Give the account a name.
- `companyName`: Company name
- `placeholder`: Your company
- `owner`: owner
- `youllBeOwner`: You’ll be the {owner}: {note}
- `invitesWaiting`: { one: "An invite is waiting for you. You can belong to one account, so creating this one supersedes it.", other: "{count} invites are waiting for you. You can belong to one account, so creating this one supersedes them.", }
- `seeInvites`: { one: "See the invite", other: "See invites" }
- `create`: Create account

## Rules for using Candor UI

- Components take plain typed data. Never pass model output as HTML or render it as a link; messages are typed blocks.
- A control that can't be used says why: wrap it in `<Locked reason="…">`, don't just disable it.
- Don't show a value you don't have: leave it out (it renders as —) rather than guess. An estimate is labelled as one.
- Nothing is pre-selected in a decision a person makes, and the agent is named from your app's data, never from model output.
- Your app's words go in `LocaleProvider` (fixed strings) and `TermsProvider` (nouns); entity kinds and agent roles in `EntityKindsProvider` and `AgentRolesProvider`.
