DAT web component reference
This page specifies the attributes, events, and event payloads of the <cmp-dat> web component.
Attributes
Attributes are passed to the <cmp-dat> element in kebab-case.
Boolean attributes are supplied as strings ("true" or "false").
| Attribute | Type | Default | Required | Description |
|---|---|---|---|---|
|
string |
— |
Yes |
URL of the asset to transform. |
|
string |
— |
Yes |
Display title shown in the header. |
|
string |
— |
Yes |
Bearer token used to authenticate AI transform requests. |
|
string |
— |
Yes |
Client identifier sent as the |
|
string |
No |
GraphQL API endpoint. |
|
|
string |
|
No |
Label of the primary action button. |
|
string |
— |
No |
Label of the secondary action button. |
|
boolean |
|
No |
Enables the AI features: remove background, generative expand, and generative fill. |
|
boolean |
|
No |
Shows the adjustments tab. |
|
boolean |
|
No |
Enables the crop tool. |
|
boolean |
|
No |
Shows the copy link button. |
|
boolean |
|
No |
Shows the download button. |
|
boolean |
|
No |
Enables Mixpanel event tracking. |
Custom events
All events bubble and are composed, so they cross the Shadow DOM boundary.
Event data is available on event.detail.
| Event | Fires when | Payload |
|---|---|---|
|
The user selects the close button. |
|
|
The user selects the primary, download, or secondary action. |
|
|
An external system requests the current state. |
|
|
The component responds to |
|
|
Any transformation value changes. |
|
|
The user selects the secondary action. |
|
dat-selected-asset payload
The dat-selected-asset event carries the following fields on event.detail.
name-
Text. Required. Display name of the selected asset.
url-
Text. Required. URL of the selected asset, including any applied transformations.
filename-
Text. Optional. Filename of the selected asset.
source-
Enum. Required. The action that produced the event:
primary,download, orsecondary. assets-
Array. Optional. One entry per generated asset (for example, each variant of a multi-output transformation). See the asset entry fields below.
aiTransforms-
Array. Optional. Records of the AI operations applied to the asset.
transforms-
Object. Optional. The decoded standard transformations applied to the asset.
Each entry in the assets array contains the following fields.
url-
Text. URL of the generated asset.
filename-
Text. Filename of the generated asset.
width-
Number. Width of the generated asset in pixels.
height-
Number. Height of the generated asset in pixels.
label-
Text. Label identifying the variant.
ratio-
Text. Aspect ratio of the generated asset.