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

# msm-image-upload

> Upload UI component.

`msm-image-upload` is a web component built with Lit.

## Purpose

Render media content (images/video).

## Usage

```html theme={null}
<msm-image-upload></msm-image-upload>
```

## Attributes / properties

| Name       | Type    | Default                                   | Notes |
| ---------- | ------- | ----------------------------------------- | ----- |
| `variant`  | string  | `UploadType.fromValue(this.variant).name` |       |
| `command`  | string  | -                                         |       |
| `cdn-root` | string  | `""`                                      |       |
| `path`     | string  | `""`                                      |       |
| `src`      | string  | -                                         |       |
| `required` | boolean | -                                         |       |

## Events

| Event              | detail     | When |
| ------------------ | ---------- | ---- |
| `msm-image-upload` | `imageUrl` |      |
| `msm-image-remove` | `imageUrl` |      |

### Usage

```html theme={null}
<msm-image-upload>
</msm-image-upload>

<script>
  const el = document.querySelector("msm-image-upload");
  el.addEventListener("msm-image-upload", (e) => {
    console.log(e.detail);
  });

  el.addEventListener("msm-image-remove", (e) => {
    console.log(e.detail);
  });

</script>
```

## CSS parts

* `base`

## Slots

No documented slots.

## Methods

* `validate()`

## Notes

* Custom events bubble.
