# Getting started (https://divplate.com/docs/getting-started)



<SetupPaths>
  <SetupPath value="with-an-agent">
    <Steps>
      <Step title="Open your project">
        In Cursor or another agent that can run commands. Starting from scratch? An
        empty folder works.
      </Step>

      <Step id="setup-prompt" title="Copy the setup prompt">
        <SetupPrompt>
          ```text title="Setup prompt"
          Set up Divplate in this project, then help me build with it. Divplate is a
          library of website sections that installs with the shadcn CLI.

          Setup:
          1. If this folder has no project yet, create one:
             npx shadcn@4.21.4 init --defaults --no-monorepo --name my-site
             That makes a Next.js project with Tailwind v4 and shadcn/ui in the folder
             my-site. Do everything else in that folder.
          2. Check that .gitignore covers .env.local. Add the line if it is missing.
          3. Run this command once, exactly as written:
             npx shadcn@4.21.4 add https://divplate.com/r/setup/YOUR-CODE.json
             It writes my license key into .env.local as DIVPLATE_TOKEN. The address
             works one time. Do not open it yourself, do not view or dry-run it first,
             and do not print .env.local. If the command fails, stop and tell me to
             copy a new setup prompt at https://divplate.com/docs/getting-started.
          4. In components.json, add this to "registries":
             "@divplate": {
               "url": "https://divplate.com/r/{name}.json",
               "headers": { "Authorization": "Bearer ${DIVPLATE_TOKEN}" }
             }
          5. Run: npx shadcn@4.21.4 add @divplate/tokens --yes
             Without --yes it stops at a question you cannot answer. Then read
             components/blocks/AGENTS.md, which that command installed, and
             follow it for everything you build here. If the command says the key is
             not recognized, delete the DIVPLATE_TOKEN line from .env.local, stop and
             ask me for a new setup prompt.

          Then ask me what to build first, and wait for my answer:
          a) A landing page for my product.
          b) Blocks I name, such as "Hero 10, Pricing 02, FAQ 05".
          c) Nothing yet.

          For a landing page, ask me in one message what the product is, who it is
          for, and whether I have prices, a screenshot, customer logos or customer
          quotes to show. Then build the home page from one block per section, in this
          order: navbar, hero, features, steps, pricing, FAQ, call to action, footer.
          Add logos, testimonials or stats only if I gave you real ones. Choose each
          block from its category's index, which lists every block with its full
          description, such as https://divplate.com/r/registry-pricing.json; the
          categories are listed at https://divplate.com/llms.txt. Install them all with
          one npx shadcn@4.21.4 add command, and write my product into every text.

          For everything you build with Divplate:
          - Install a block with the command. Do not rebuild one from its preview.
          - Check the page in light and in dark mode before you say it is done.
          - Never invent testimonials, customer names, logos, numbers or prices. Where
            I gave you none, leave that section out, or keep the sample text and tell
            me which texts are still samples.
          - When you are done, start the site and tell me the address to open.
          ```
        </SetupPrompt>
      </Step>

      <Step title="Paste it into your agent">
        It sets up the project, then asks what to build.
      </Step>
    </Steps>

    <Asks>
      After that, just ask:

      * "Build a landing page for my app."
      * "Use Hero 12 with Navbar 07 and Logos 04."
      * "Add grid lines to the page and make it dark."
    </Asks>

    <Callout title="Setup failed?" icon="alert">
      A prompt works once, for 60 minutes. Copy a fresh one and try again.
    </Callout>

    <Callout title="Your license key" icon="key">
      The setup command fetches the key from our server and writes it straight into
      a file in your project, without showing it in the chat. Your assistant can
      open that file like any other file in your project. The prompt asks it not to.
      On a Team license, everyone on the team uses the same key.
    </Callout>
  </SetupPath>

  <SetupPath value="by-hand">
    Your project needs Tailwind v4 and shadcn/ui. Starting from scratch? This
    creates one:

    ```bash
    npx shadcn@4.21.4 init --defaults
    ```

    <Steps>
      <Step id="connecting-the-registry" title="Connect Divplate">
        Add the registry to `components.json`:

        ```json title="components.json"
        {
          "registries": {
            "@divplate": {
              "url": "https://divplate.com/r/{name}.json",
              "headers": { "Authorization": "Bearer ${DIVPLATE_TOKEN}" }
            }
          }
        }
        ```
      </Step>

      <Step id="your-key" title="Add your license key">
        Put it in `.env.local`, in the same folder as `components.json`:

        <KeyLine>
          ```bash title=".env.local"
          DIVPLATE_TOKEN=your license key
          ```
        </KeyLine>

        On a Team license, everyone on the team uses the same key.
      </Step>

      <Step id="installing-a-block" title="Install a block">
        ```bash
        npx shadcn@4.21.4 add @divplate/hero-04
        ```

        Then use it:

        ```tsx title="app/page.tsx"
        import { Hero04 } from "@/components/blocks/sections/hero-04"

        export default function Page() {
          return <Hero04 />
        }
        ```
      </Step>
    </Steps>

    For the exact colors from the previews, add the theme:

    ```bash
    npx shadcn@4.21.4 add @divplate/theme
    ```

    It recolors the shadcn components you already have, too. More in
    [Colors](https://divplate.com/docs/colors#matching-the-previews).
  </SetupPath>
</SetupPaths>

## Next [#next]

<Cards>
  <Card title="Browse the library" description="Every block, with a live preview" href="/library/blocks" />

  <Card title="AI assistants" description="What to ask your agent" href="/docs/ai-assistants" />

  <Card title="Troubleshooting" description="Errors and how to fix them" href="/docs/troubleshooting" />
</Cards>
