# Blocks installation

import { Callout } from "fumadocs-ui/components/callout";
import { Step, Steps } from "fumadocs-ui/components/steps";
import { Badge } from "@pycolors/ui";

<div className="flex flex-wrap items-center gap-2">
  <Badge variant="outline">
    Blocks
  </Badge>

  <Badge>
    Source copy
  </Badge>
</div>

[Explore the Blocks catalog](/blocks) to choose an application shell,
authentication panel, commerce surface, data table, account/workspace surface,
empty state or other documented pattern before following the installation steps
below.

In the catalog, open **Code** to inspect the complete source and its folder
structure. The file tree is visible by default beside the code on desktop and
above it on mobile. Use **Files** to hide or show it; blocks with multiple files
also have a file selector on mobile.

**Download ZIP** saves the complete block in one archive, preserving the displayed
`src/components/blocks/<block-slug>/` structure. Extract it, then move the block's
folder into your app. **Copy file** copies only the selected file; you can also
select the code manually if copying is unavailable. Keep all files together and
preserve their relative imports.

Simple blocks stay in one file. Larger compositions use a few focused files with
an `index.tsx` entry point. The ZIP contains the same source shown in the explorer;
configure React, the public UI package and tokens in your own application.

## Copy source, then own it

PyColors Blocks use a manual source-copy flow. When a Block is available, copy
its canonical source directory into your application, then treat the copied code
as your own product code.

<Callout title="Canonical documented Blocks">
  The category and naming contract is approved. The documented catalog includes
  [`app-shells/responsive-sidebar`](/docs/blocks/app-shells/responsive-sidebar),
  [`auth/sign-in`](/docs/blocks/auth/sign-in),
  [`auth/sign-up`](/docs/blocks/auth/sign-up),
  [`auth/password-recovery`](/docs/blocks/auth/password-recovery),
  [`data/data-table`](/docs/blocks/data/data-table),
  [`data/stats-overview`](/docs/blocks/data/stats-overview),
  [`account/settings-panel`](/docs/blocks/account/settings-panel),
  [`account/onboarding-checklist`](/docs/blocks/account/onboarding-checklist),
  [`commerce/pricing-plans`](/docs/blocks/commerce/pricing-plans),
  [`commerce/billing-overview`](/docs/blocks/commerce/billing-overview),
  [`commerce/payment-method`](/docs/blocks/commerce/payment-method),
  [`commerce/invoice-history`](/docs/blocks/commerce/invoice-history),
  [`feedback/empty-state-panel`](/docs/blocks/feedback/empty-state-panel),
  [`account/workspace-members`](/docs/blocks/account/workspace-members),
  [`account/workspace-invitations`](/docs/blocks/account/workspace-invitations)
  and [`account/audit-log`](/docs/blocks/account/audit-log). Other merged
  canonical source is surfaced through separately reviewed docs/catalog parity
  issues before it becomes part of this public discovery contract.
</Callout>

There is no `@pycolors/blocks` package, proprietary PyColors CLI, or automatic
synchronization. Copying source does not change a package version and does not
require a Changeset.

The [Registry pilot guide](/docs/registry) documents a separate base and
`feedback-empty-state-panel` workflow through the upstream shadcn CLI. Public
mirror installation still requires its separate availability check. The manual
flow on this page stays supported and is not replaced by the pilot.

## Canonical source location

The PyColors repository keeps canonical Block source at:

```text
apps/marketing/content/blocks/<category-slug>/<block-slug>/
```

Both path segments use lowercase kebab-case. `<category-slug>` must be one of
the approved slugs below, and each production Block owns one stable
`<block-slug>`.

## Approved categories

Every Block has exactly one primary category. Tags may support secondary
discovery without creating duplicate source or category aliases.

| Category            | Slug         | Source-owner issues |
| ------------------- | ------------ | ------------------- |
| Application shells  | `app-shells` | #94                 |
| Authentication      | `auth`       | #95                 |
| Commerce            | `commerce`   | #96 and #98         |
| Account & workspace | `account`    | #97 and #99         |
| Data & records      | `data`       | #101                |
| Feedback & states   | `feedback`   | #100                |

Source, documentation navigation, and Registry metadata use the same
`<category-slug>/<block-slug>` identity. For example, `data/data-table` maps to
the documentation route `/docs/blocks/data/data-table` and, only after a
separate Registry approval, the Registry item `data-data-table`.

Free and Pro availability are separate metadata on this shared identity. They
do not create different taxonomies or expose private source.

Documentation previews must import or render canonical Block source where
practical. A preview is never an alternate implementation to copy from.

<Callout title="Source authority">
  `@pycolors/ui` and `@pycolors/tokens` remain the public primitive and token
  authorities. Starter Free is product evidence and documentation previews are
  examples, not alternate Block source. Registry artifacts distribute canonical
  source only, while future Pro remains a separate authority under #36. The
  approved first source sequence was #94, then #101, then #97; current
  sequencing is coordinated by #35.
</Callout>

## Install a Block

<Steps>
  <Step>
    ### Copy the complete source directory

    Copy the canonical `<block-slug>` directory into a location your app owns,
    such as `src/components/blocks/<block-slug>`. Keep the Block's local files
    together so its relative imports remain local to the copied source.

    Use **Download ZIP** in the catalog's Code view to retrieve every file at
    once, or copy each file individually. The archive is assembled in your browser
    from the displayed source. It does not install dependencies or update your app.
  </Step>

  <Step>
    ### Use public PyColors UI imports

    Install and configure `@pycolors/ui` in the consuming app by following the
    [UI installation guide](/docs/ui/installation). Block source must import
    PyColors primitives from the public package entry point only when it needs
    them.

    ```tsx title="src/components/blocks/<block-slug>/index.tsx"
    import { Button, Card } from "@pycolors/ui";
    ```

    Do not use `@pycolors/ui/src/*`, `@pycolors/ui/dist/*`, internal app
    aliases, or private `@pycolors/*` packages. React or Next imports are
    appropriate only when the copied Block actually needs them.
  </Step>

  <Step>
    ### Customize the copied code

    The copied code belongs to your application. Adapt it to your routes,
    content, styling, state, and product rules. PyColors does not automatically
    update or synchronize copied Block source.
  </Step>

  <Step>
    ### Validate the result

    Run your application's lint, type-check, test, and build commands after
    copying or customizing a Block. Preserve accessible semantics, keyboard
    behavior, labels, and visible focus states while making changes.
  </Step>
</Steps>

## Repository checks

PyColors maintainers validate this source-copy contract with:

```bash
pnpm check:blocks-contract
pnpm test:blocks-contract
pnpm --filter pycolors-marketing lint
pnpm --filter pycolors-marketing types:check
pnpm --filter pycolors-marketing build
```

The structural check enforces the exact category allowlist and lowercase
kebab-case names, rejects empty placeholders, deep `@pycolors/ui` imports,
internal app or package imports, and package, registry, or CLI artifacts. It
validates the delivery contract without creating a sample production Block.

## Updates are deliberate

Blocks are source copies, not a managed dependency. If a future canonical
version changes, review it deliberately and bring across only the changes that
fit your application. Your copy remains under your control until you choose to
update it.

## Copy directly from the documentation

Each available Block has a **Copy source** section with its complete canonical
implementation. You do not need to locate monorepo files to inspect or copy that
code:

* [Copy AI chat](/docs/blocks/app-shells/ai-chat#copy-source).
* [Copy Responsive sidebar](/docs/blocks/app-shells/responsive-sidebar#copy-source).
* [Copy Sign in](/docs/blocks/auth/sign-in#copy-source).
* [Copy Sign up](/docs/blocks/auth/sign-up#copy-source).
* [Copy Password recovery](/docs/blocks/auth/password-recovery#copy-source).
* [Copy Data table](/docs/blocks/data/data-table#copy-source).
* [Copy Stats overview](/docs/blocks/data/stats-overview#copy-source).
* [Copy Settings panel](/docs/blocks/account/settings-panel#copy-source).
* [Copy Onboarding checklist](/docs/blocks/account/onboarding-checklist#copy-source).
* [Copy Pricing plans](/docs/blocks/commerce/pricing-plans#copy-source).
* [Copy Billing overview](/docs/blocks/commerce/billing-overview#copy-source).
* [Copy Payment method](/docs/blocks/commerce/payment-method#copy-source).
* [Copy Invoice history](/docs/blocks/commerce/invoice-history#copy-source).
* [Copy Empty state panel](/docs/blocks/feedback/empty-state-panel#copy-source).
* [Copy Workspace members](/docs/blocks/account/workspace-members#copy-source).
* [Copy Workspace invitations](/docs/blocks/account/workspace-invitations#copy-source).
* [Copy Audit log](/docs/blocks/account/audit-log#copy-source).

Open **Source**, choose a file when tabs are available, then use the code block's
copy button or select the code manually. Save it at the application-owned path
shown above the source and continue with that guide's usage example.
Configure the [public UI package and tokens](/docs/ui/installation) first;
copied source does not install dependencies or styles for you.

Each displayed file is included from canonical source when the documentation
builds. Your application copy remains independent: review changes deliberately,
validate your integration, and keep local customizations under version control.
There is no new installer or automatic update service.

Need a whole application rather than one pattern? [Compare Starters](/starters).