> ## Documentation Index
> Fetch the complete documentation index at: https://loops.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Components

> View, create, and update email components.

The `components` command lets you view, create, and update [components](/docs/creating-emails/components) saved in your Loops account.

## `create`

Create a new component. Pass [LMX](/docs/creating-emails/lmx) inline with `--lmx` or from a file with `--lmx-file`:

```bash theme={"dark"}
loops components create --name "Header" --lmx "<mj-text>Hello</mj-text>"
```

```bash theme={"dark"}
loops components create --name "Header" --lmx-file ./header.lmx
```

### Flags

| Flag         | Description                                                                                    |
| ------------ | ---------------------------------------------------------------------------------------------- |
| `--name`     | Component name <Badge color="red" size="sm">Required</Badge>                                   |
| `--lmx`      | [LMX](/docs/creating-emails/lmx) markup (inline). Mutually exclusive with `--lmx-file`.             |
| `--lmx-file` | Path to a file containing [LMX](/docs/creating-emails/lmx) markup. Mutually exclusive with `--lmx`. |

## `get`

Get a component by ID.

```bash theme={"dark"}
loops components get cmn5ziajr01oztzlifwarda8m
```

## `list`

List components.

```bash theme={"dark"}
loops components list
```

Pass `--pick` to filter the list interactively with [fzf](https://github.com/junegunn/fzf) and copy the selected component ID to your clipboard. Requires `fzf` to be installed and on your `PATH`.

```bash theme={"dark"}
loops components list --pick
```

### Flags

| Flag         | Description                                                                                                       |
| ------------ | ----------------------------------------------------------------------------------------------------------------- |
| `--pick`     | Interactively pick a component and copy its ID to the clipboard. Requires [fzf](https://github.com/junegunn/fzf). |
| `--per-page` | Results per page (10–50, default 20)                                                                              |
| `--cursor`   | Pagination cursor for a specific page                                                                             |

## `update`

Update a component.

```bash theme={"dark"}
loops components update cmn5ziajr01oztzlifwarda8m --name "Header" --lmx-file ./header.lmx
```

### Flags

| Flag         | Description                                                                                    |
| ------------ | ---------------------------------------------------------------------------------------------- |
| `--name`     | Component name                                                                                 |
| `--lmx`      | [LMX](/docs/creating-emails/lmx) markup (inline). Mutually exclusive with `--lmx-file`.             |
| `--lmx-file` | Path to a file containing [LMX](/docs/creating-emails/lmx) markup. Mutually exclusive with `--lmx`. |


## Related topics

- [Components](/docs/creating-emails/components.md)
- [API Introduction](/docs/api-reference/intro.md)
- [LMX](/docs/creating-emails/lmx.md)
- [Get a component](/docs/api-reference/get-component.md)
- [Update a component](/docs/api-reference/update-component.md)
