> For the complete documentation index, see [llms.txt](https://docs.protoboard.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.protoboard.xyz/parts/edit-part-templates.md).

# Edit part templates

Create blank parts, edit a part template's ProtoPart JSON, swap a part's template and attach datasheets, images and other artifacts

## Goal

Model a part the library doesn't have, or correct a template on your board.

A **template** is a board's copy of a part definition, written in the open [ProtoPart](https://docs.protoboard.xyz/reference/protopart-schema.md) format. Every part that uses it on the board picks up your edits. Edits stay on this board; they don't change the library.

## Start from a blank part

1. Click **Add Blank Part** in the canvas toolbar or the Parts Bin header.
2. Select the new part and give it a **Nickname**.
3. Define its interfaces and resources by editing the template JSON (below), or ask ProtoBot: "Model this as a Pololu QTR-MD-05A from its datasheet".

A blank part shows the **Blank** badge until it has interfaces or resources, then **Unvalidated**. See [Part status](https://docs.protoboard.xyz/parts/part-status.md).

## Edit the template JSON

1. Select a part and open the template's **⋮** menu in the Inspector, then **Edit Part**. (In the Parts Bin's **In Project** tab, use **Edit Template**.)
2. Edit the JSON in the **Edit Template** dialog. Keys and values are case-sensitive.
3. Save. Closing with unsaved edits asks **Discard your changes?**.

<figure><picture><source srcset="https://3535233690-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHc6ZGiGpKHrs578383AS%2Fuploads%2Fgit-blob-24435cf050dce47436a43e5b919e96e1c9fd6b39%2Ftemplate-json-editor-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://3535233690-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHc6ZGiGpKHrs578383AS%2Fuploads%2Fgit-blob-45794ffa0d6eddebb17578403f020e2bfc9240a1%2Ftemplate-json-editor-light.png?alt=media" alt="The Edit Template dialog showing a part template&#x27;s ProtoPart JSON in a code editor"></picture><figcaption><p>The Edit Template dialog.</p></figcaption></figure>

Before you change interfaces, read [Interfaces and Harnesses](https://docs.protoboard.xyz/reference/interfaces-and-harnesses.md) for protocol and role names.

## Other template actions

| Action                                  | Where                      | What it does                                                                                                                                                          |
| --------------------------------------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Duplicate Template**                  | Inspector ⋮, In Project ⋮  | Make an independent copy to change without affecting other parts                                                                                                      |
| **Export Part** / **Download Template** | Inspector ⋮, Parts Bin ⋮   | Save the definition as a file                                                                                                                                         |
| **Import Part**                         | Parts Bin header           | Load a definition file                                                                                                                                                |
| **Swap template**                       | Inspector, Template Status | Replace this part's template with another, keeping its position, nickname and the wiring that still fits. An **Interface remap** step maps old interfaces to new ones |
| **Delete Template**                     | In Project ⋮               | Remove the template; the dialog lists parts that use it                                                                                                               |

## Artifacts

The **Artifacts** tab on a part holds links and files for its template: **Image**, **Code / Repository**, **CAD**, **Datasheet** or **Generic Link**. Add one with **Add Artifact**. In a row's menu, **Set as preview** uses an image as the part's thumbnail.

## Custom fields

**Add Custom Field** on a part adds your own property (**Field Key**, **Display Label**, a String, Number or Boolean **Type**, and an **Initial Value**).

## Common failures

<details>

<summary>My edit made a harness red</summary>

You changed an interface's protocol or role, or removed a function the harness used. Check the DRC reason and fix the template or the harness.

</details>

<details>

<summary>"Template out of sync"</summary>

The part's template changed since the copy you're working from. Choose **Keep my version** or **Add a fresh copy**.

</details>

## Related pages

* [ProtoPart Schema](https://docs.protoboard.xyz/reference/protopart-schema.md)
* [Request or fix a part](https://docs.protoboard.xyz/parts/request-or-fix-a-part.md): get your fix into the library
* [Part status](https://docs.protoboard.xyz/parts/part-status.md)
