Loving Tina? ⭐️ us on GitHubStar

Docs

Learn

v.Latest
Documentation
Image Fields
Table of Contents

A dedicated file input that stores the URL or path of an uploaded image.

It supports external media library integration, but also repo-based media configurations.

Images can be uploaded to the image component with drag-and-drop actions, or with the dedicated media manager that comes with the CMS.

Type Definition

For additional properties common to all Field types, check the Field type definition.
REQUIRED
type
string

Set this to "image" to use the Image Field.


REQUIRED
name
string

The name of the field for internal use.

All properties marked as REQUIRED must be specified for the field to work properly.

Example

Simple field

{
type: 'image',
label: 'Hero image',
name: 'imgSrc',
}

Field with image path formatting

If you need to customize how an image is formatted in a field, you can use the format & parse options.

{
type: "image",
name: "heroImg",
label: "Hero Image",
ui: {
format(value) {
//add leading slash to value if it doesnt exist
return value.startsWith("/") ? value : `/${value}`;
},
parse(value) {
//remove leading slash if it exists
return value.startsWith("/") ? value.slice(1) : value;
},
}
}
Last Edited: March 13, 2025