Skip to content

Global Components

The following Vue components are globally registered and available without importing them.

Each runtime (edit and display) registers its own set of global components. In the CEK, these are mock implementations for local development (e.g. TailorEmbeddedContainer renders example elements, TailorAssetInput uploads to the local dev server). In production, the host application (Tailor CMS for authoring, the LMS for display) registers its own implementations that connect to the real storage, element registry, and other platform services. The API (props and events) is the same across environments.

Edit Runtime

Registered by the CEK edit runtime and Tailor CMS. Available in Edit, TopToolbar, and SideToolbar components.

TailorFileInput

File picker component with upload dialog (drag & drop) and optional URL import tab. Auto-detects asset type from extensions to resolve icon, label, and button text. Handles file upload via $storageService.

vue
<template>
  <TailorFileInput
    :allowed-extensions="['.png', '.jpg', '.jpeg']"
    :file-key="element.data.assets?.backgroundUrl"
    allow-url-source
    @upload="onUpload"
    @input="onInput"
    @delete="onDelete"
  />
</template>

<script setup lang="ts">
import type { Element, ElementData } from 'tce-manifest';

const props = defineProps<{ element: Element }>();
const emit = defineEmits<{ save: [data: ElementData] }>();

const onUpload = ({ url, publicUrl }: Record<string, any>) => {
  const assets = { backgroundUrl: url };
  emit('save', { ...props.element.data, backgroundUrl: publicUrl, assets });
};

const onInput = (payload: Record<string, any> | null) => {
  if (!payload) return;
  emit('save', { ...props.element.data, backgroundUrl: payload.publicUrl });
};

const onDelete = () => {
  emit('save', {
    ...props.element.data,
    backgroundUrl: undefined,
    assets: undefined,
  });
};
</script>

Props

PropTypeDefaultDescription
file-keystring''Storage key or storage:// URI of the current file
file-namestring''Display name; falls back to parsing from fileKey
allow-url-sourcebooleanfalseShow URL import tab in the picker dialog
allowed-extensionsstring[][]Accepted extensions with dot prefix (e.g. ['.jpg', '.png']); drives icon/label auto-detection
use-field-inputbooleanfalseUse field input + card rendering instead of default button mode
show-previewbooleanfalseEnable image thumbnail + overlay on the file card; auto-enabled for image extensions
public-urlstring | nullnullPre-resolved public URL; skips async fetch when present
labelstring''Override auto-inferred label (derived from extensions)
placeholderstring''Override button text (e.g. 'Upload image')
iconstring''Override auto-inferred icon (derived from extensions)
variantVTextField['variant']'outlined'Vuetify variant for the text field (field input mode)
densityVTextField['density']'default'Vuetify density for the text field (field input mode)
darkbooleanfalseDark theme variant for the file preview card

Events

EventPayloadDescription
@upload{ key, name, url, publicUrl }File uploaded via drag & drop or file picker
@input{ url, publicUrl, title? } | nullURL imported (from URL tab), or null on clear
@deleteFile cleared by the user

Auto-inferred values from allowedExtensions:

  • Image extensions → icon mdi-image-outline, label Image, button Choose image
  • Video → mdi-video-outline / Video / Choose video
  • Audio → mdi-volume-medium / Audio / Choose audio
  • Document → mdi-file-document-outline / Document / Choose document
  • Fallback → mdi-file / File / Choose file

TailorAssetInput (legacy)

The previous asset input component with inline edit/save/cancel state. Still registered globally for backward compatibility. New elements should use TailorFileInput instead.

See the File storage section for details on asset URL handling.

TailorElementPlaceholder

Placeholder component shown when no content has been provided yet (e.g. no image uploaded, no URL set). Displays a centered icon, name, and contextual instructions that change based on focus state.

vue
<template>
  <TailorElementPlaceholder
    v-if="!element.data.url"
    :icon="manifest.ui.icon"
    :is-disabled="isReadonly"
    :is-focused="isFocused"
    :name="`${manifest.name} component`"
    active-icon="mdi-arrow-up"
    active-placeholder="Use toolbar to enter the url"
  />
</template>

Props

PropTypeDefaultDescription
iconstringrequiredMDI icon name
namestringrequiredElement display name
placeholderstring'Select to edit'Text shown when unfocused
active-placeholderstring'Use toolbar to edit'Text shown when focused
active-iconstring | nullnullIcon shown next to active placeholder
active-colorstring'#fff'Icon color when focused
densebooleanfalseCompact variant (smaller icon/text)
is-focusedbooleanfalseFocus state
is-disabledbooleanfalseDisabled state (greys out icon and text)

TailorEmbeddedContainer

Interactive container for embedded child elements within composite elements. Supports adding, editing, deleting, and reordering embedded elements.

vue
<template>
  <TailorEmbeddedContainer
    :container="element.data"
    :is-readonly="isReadonly"
    @save="emit('save', $event)"
  />
</template>

Props

PropTypeDefaultDescription
containerobjectrequiredData field containing embeds in key-value format
allowed-elements-configarray[]Element configs allowed to be embedded
is-readonlybooleanfalseDisable editing
enable-addbooleantrueShow add element button
add-element-optionsobjectsee belowOptions for the add element button

Default addElementOptions:

ts
{
  large: false,
  label: 'Add content',
  icon: 'mdi-plus',
  color: 'primary-darken-4',
  variant: 'tonal',
}

Events

EventPayloadDescription
@saveobjectUpdated container object with modified embeds
@deleteobjectElement to be deleted

See Composite Elements for usage details.

TailorContentElement

Internal

Used internally by TailorEmbeddedContainer to render individual embedded elements. Not intended for direct use by element authors.

Renders a single embedded element with edit controls (text input, delete button on hover).

Props

PropTypeDefaultDescription
elementobjectrequiredElement entity
parentobject | nullnullParent element (hides delete when set)
is-readonlybooleanfalseDisable editing

Events

EventPayloadDescription
@saveobjectUpdated element data
@deleteobjectElement to be deleted

Display Runtime

Registered by the CEK display runtime. In production, the LMS that consumes the Display package is responsible for registering these components.

TailorEmbeddedContainer

Read-only container that renders embedded child elements for display.

vue
<template>
  <TailorEmbeddedContainer :elements="elements" />
</template>

Props

PropTypeDefaultDescription
elementsarrayrequiredArray of embedded element objects to render