# Components and kits

Install, remove and list components and kits, and read the naming standard.

## add

Install a component from the catalog (contract, code, stories, specs; dependencies first), or --blank to scaffold a new contract (status draft, proposed decision).

```
sketchbook add <Component Name...> [--blank] [--dry-run] [--json]
```

Changes files; supports `--dry-run`.

| Argument | Meaning |
| --- | --- |
| `Component Name` | Catalog name (button, "Button Group") or a registry entry for --blank |

| Option | Meaning |
| --- | --- |
| `--blank` | Scaffold an empty contract instead of installing from the catalog |

**Examples**

- `sketchbook add button`
- `sketchbook add Button Group --dry-run`
- `sketchbook add Date Picker --blank`

## remove

Uninstall a component: refuses while another component or a kit needs it, and without --yes when it is team-made or customized; else removes its files, sets the registry to planned and rebuilds.

```
sketchbook remove <Component Name...> [--yes] [--dry-run] [--json]
```

Changes files; supports `--dry-run`.

| Argument | Meaning |
| --- | --- |
| `Component Name` | Installed component (button, "Button Group") |

| Option | Meaning |
| --- | --- |
| `--yes` | Confirm removing a component the catalog cannot bring back as it is (team-made or customized) |

**Examples**

- `sketchbook remove badge`
- `sketchbook remove spinner --dry-run`
- `sketchbook remove my-widget --yes`

## list

List catalog components (installed or available) with what each needs, plus template kits (read-only).

```
sketchbook list [--installed] [--available] [--json]
```

Read-only.

| Option | Meaning |
| --- | --- |
| `--installed` | Only installed components (including ones the team made) |
| `--available` | Only catalog components not installed yet |

**Examples**

- `sketchbook list`
- `sketchbook list --available`
- `sketchbook list --installed --json`

## kits

Template kits (harness/kits/index.json): list them, add one (its components come from the catalog first) or remove one (--yes when it was edited).

```
sketchbook kits [action] [kit...] [--yes] [--dry-run] [--json]
```

Changes files; supports `--dry-run`.

| Argument | Meaning |
| --- | --- |
| `action` (optional) | list (default) | add | remove |
| `kit` (optional) | Kit id(s), e.g. sign-in settings |

| Option | Meaning |
| --- | --- |
| `--yes` | remove: confirm removing a kit whose files differ from the catalog (your edits are only in git) |

| Subcommand | What it does |
| --- | --- |
| `sketchbook kits list` | See `sketchbook help kits`. |
| `sketchbook kits add` | See `sketchbook help kits`. |
| `sketchbook kits remove` | See `sketchbook help kits`. |

**Examples**

- `sketchbook kits list`
- `sketchbook kits add sign-in --dry-run`
- `sketchbook kits remove dashboard`
- `sketchbook kits remove dashboard --yes`

## api

The API vocabulary (spec/api.json): list every component prop, event and state against it (canonical, alias, extension), check that nothing is unregistered, explain one name, show the design-file axes and properties one component gets (figma), or the design-file practices Sketchbook adopted (practices, spec/figma-practices.json).

```
sketchbook api [action] [name] [--json]
```

Read-only.

| Argument | Meaning |
| --- | --- |
| `action` (optional) | list (default) | check | explain |
| `name` (optional) | list: a component; explain: a prop, content or state name; practices: an aspect |

| Subcommand | What it does |
| --- | --- |
| `sketchbook api list` | See `sketchbook help api`. Read-only. |
| `sketchbook api check` | See `sketchbook help api`. Read-only. |
| `sketchbook api explain` | See `sketchbook help api`. Read-only. |
| `sketchbook api figma` | See `sketchbook help api`. Read-only. |
| `sketchbook api practices` | See `sketchbook help api`. Read-only. |

**Examples**

- `sketchbook api list`
- `sketchbook api list button`
- `sketchbook api check`
- `sketchbook api explain selected`
