> ## 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](https://loops.so/docs/creating-emails/components.md) saved in your Loops account.

## `create`

Create a new component. Pass [LMX](https://loops.so/docs/creating-emails/lmx.md) 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 Required |
| `--lmx` | [LMX](https://loops.so/docs/creating-emails/lmx.md) markup (inline). Mutually exclusive with `--lmx-file`. |
| `--lmx-file` | Path to a file containing [LMX](https://loops.so/docs/creating-emails/lmx.md) 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](https://loops.so/docs/creating-emails/lmx.md) markup (inline). Mutually exclusive with `--lmx-file`. |
| `--lmx-file` | Path to a file containing [LMX](https://loops.so/docs/creating-emails/lmx.md) markup. Mutually exclusive with `--lmx`. |


## Related topics

- [Components](https://loops.so/docs/creating-emails/components.md)
- [Get a component](https://loops.so/docs/api-reference/get-component.md)
- [Update a component](https://loops.so/docs/api-reference/update-component.md)
- [Create a component](https://loops.so/docs/api-reference/create-component.md)
- [List components](https://loops.so/docs/api-reference/list-components.md)
