> ## Documentation Index
> Fetch the complete documentation index at: https://strapi-suite.littlebox.pt/llms.txt
> Use this file to discover all available pages before exploring further.

# Image

> Add a single image or a gallery to any content type. Every image is cropped with zoom and saved as an optimized WebP file.

The "Littlebox Image" field holds a single image or a gallery. It works like Strapi's "Media" field, with three
differences:

* Every image goes through a **crop with zoom**, so you choose exactly which part of the image to keep.
* Strapi saves only the final image, as an optimized **WebP** file. WebP is a modern image format that keeps good
  quality at a much smaller file size than JPEG or PNG.
* You can set a **fixed size**, so every image of the field comes out with the same width and height.

The saved images live in the Media Library, in a folder called "Littlebox". Strapi creates its usual formats for
each one (`thumbnail`, `small`, `medium` and `large`).

## Create the field

**Step 1**: Access the Strapi admin panel.\
**Step 2**: Go to the *Content-Type Builder*.\
**Step 3**: Select the collection type, single type or component that needs the image.\
**Step 4**: Click "Add another field".\
**Step 5**: Go to the *Custom* tab.\
**Step 6**: Select "Littlebox Image".\
**Step 7**: Fill in the basic settings:

| Setting | What it does |
| - | - |
| Name | The field name in the API, for example `cover` or `gallery`. |
| Mode | "Single image" holds one image. "Gallery" holds a list of images in the order you choose. The default is "Single image". |
| Width (px) | Optional, from 1 to 6000. The suggested width of every image. |
| Height (px) | Optional, from 1 to 6000. The suggested height of every image. |
| Lock this size | Saves every image at exactly the width and height above. It needs both values. |

![](https://mintcdn.com/littlebox/7czXCWihyCQwyusF/images/backend-custom-fields-image-basic-settings.png?fit=max\&auto=format\&n=7czXCWihyCQwyusF\&q=85\&s=cf4e2a790243971f006ccf931541ed9b)

**Step 8**: Go to the *Advanced settings* tab if you need these settings:

| Setting | What it does |
| - | - |
| Required field | You can't save a document while the field is empty. In gallery mode, it needs at least one image. |
| Maximum images | Gallery mode only. The most images the gallery can hold. Leave it empty for no limit. |

![](https://mintcdn.com/littlebox/7czXCWihyCQwyusF/images/backend-custom-fields-image-advanced-settings.png?fit=max\&auto=format\&n=7czXCWihyCQwyusF\&q=85\&s=0617183ea6973ad96f336c4776196300)

**Step 9**: Click "Finish", then click "Save".

### How the size settings work

| Width and height | Lock this size | What happens |
| - | - | - |
| None | — | The size is free. The crop starts with the size of the original image, up to 6000 px. |
| One or both | Off | The crop starts with this size, but the editor can change it. When you set only one value, the other follows the proportion of the image. |
| Both | On | Every image is saved at exactly this size. The editor sees the size but can't change it. |

> [!TIP]
>
> Lock the size when the design needs every image to match, such as a grid of team photos or a banner with a fixed
> height. Leave it free for images inside long articles.

If you change the size settings later, Strapi keeps the images you already saved as they are.

## Add an image

**Step 1**: Open a document in the Content Manager.\
**Step 2**: In the image field, click "Add image".\
**Step 3**: Choose the source of the image:

* drag an image into the window, or click to choose a file from your computer;
* or click "Choose from the Media Library" and pick an image that is already there.

**Step 4**: Crop the image (see below).\
**Step 5**: Type the alternative text of the image.\
**Step 6**: Click "Confirm".\
**Step 7**: Save the document.

![](https://mintcdn.com/littlebox/7czXCWihyCQwyusF/images/backend-custom-fields-image-add-dialog.png?fit=max\&auto=format\&n=7czXCWihyCQwyusF\&q=85\&s=bb776bc59ccd1062eba689f98b0233ce)

The image file can be up to 15 MB.

When you pick an image from the Media Library, Strapi never changes or deletes it. The crop creates a new file.

### Crop the image

The crop area has a fixed frame. The part of the image inside the frame is the final image.

![](https://mintcdn.com/littlebox/7czXCWihyCQwyusF/images/backend-custom-fields-image-crop.png?fit=max\&auto=format\&n=7czXCWihyCQwyusF\&q=85\&s=6585e4cdfb1b09fd70dde7d987138ad1)

* **Move** the image: drag it. The arrow keys move it 1 px, or 10 px with <kbd>Shift</kbd>.
* **Zoom**: use the slider, the mouse wheel or a pinch on the trackpad.
* **Resize**: drag the handles around the image. The corner handles keep the proportion of the image. The middle
  handles stretch one side only, which deforms the image.
* **Width and height**: type the final size of the image. While the size is free, the "Keep proportion" button
  links both values, so changing one updates the other.

The buttons above the crop area do the most common moves for you:

| Button | What it does |
| - | - |
| Fit to the crop width | Scales the image so its width matches the frame, then centers it. |
| Fit to the crop height | Scales the image so its height matches the frame, then centers it. |
| Fill the crop area | Stretches the image to match the frame exactly, then centers it. This can deform the image. |
| Center image | Centers the image without changing its size. |

A thin red line shows up when the image is centered in the frame. Near the center, the image snaps to it.

The editor warns you about three things:

* **The image doesn't fill the frame.** You can't confirm until there are no empty parts. Zoom in or move the image.
* **The image is deformed.** Its width and height are not scaled equally. You can still confirm.
* **The image will lose quality.** The cropped part is smaller than the final size, so Strapi enlarges it. You can
  still confirm.

## Manage the images

**Single image**: the field shows the image, its size and its alt text, with three actions: "Replace", "Edit alt text" and "Remove".

**Gallery**: the field shows the images as thumbnails.

* Drag the thumbnails to change their order.
* Click "Add image" to add another one. The button hides when the gallery reaches its maximum.
* Click a thumbnail to open its details. There you see the image and its size, change its alt text and click "Save alt text", or remove it.

![](https://mintcdn.com/littlebox/7czXCWihyCQwyusF/images/backend-custom-fields-image-field-filled.png?fit=max\&auto=format\&n=7czXCWihyCQwyusF\&q=85\&s=1fbddf1883f2d41f39a7ab693114da9c)

![](https://mintcdn.com/littlebox/7czXCWihyCQwyusF/images/backend-custom-fields-image-detail.png?fit=max\&auto=format\&n=7czXCWihyCQwyusF\&q=85\&s=71732e95a1441aa861b193947ef2911a)

The **alt text** (alternative text) describes the image for screen readers and search engines. Write a short
sentence that says what the image shows, for example "Littlebox Strapi Suite T-shirt on a wooden table".
Save the document to keep the new alt text in the field.

### Unused files

The field deletes the files it created once nobody uses them, so the Media Library doesn't fill up with old crops:

* When you remove or replace an image and save the document, Strapi deletes the old file.
* When you delete a document, Strapi deletes its image files.
* When you crop an image but never save the document, Strapi deletes that file after 24 hours.

Strapi keeps a file while any "Littlebox Image" field still uses it, for example in another language, in the
published version of the document, or in another document. It only deletes files from the "Littlebox" folder that
the field created. Your own Media Library files are never deleted.

## Permissions

Editors need these Media Library permissions to use the field. Set them in
*Settings* → *Administration Panel* → *Roles* → *Plugins* → *Upload*:

| Permission | Needed to |
| - | - |
| Create (upload) | Add images to the field. |
| Access the Media Library | Pick an image from the Media Library. |
| Update (crop, details, replace) | Edit the alt text of an image. |

## API

The field doesn't need `populate`. The API always returns it, with the same shape as Strapi's media field.

In single mode, the value is one image or `null`:

```json theme={null}
{
  "cover": {
    "id": 42,
    "documentId": "x8fk2m0q7c1v9b3n5h6j4l2p",
    "name": "littlebox-strapi-suite-t-shirt.webp",
    "alternativeText": "Littlebox Strapi Suite T-shirt on a wooden table",
    "caption": null,
    "width": 1200,
    "height": 800,
    "formats": {
      "thumbnail": {
        "name": "thumbnail_littlebox-strapi-suite-t-shirt.webp",
        "ext": ".webp",
        "mime": "image/webp",
        "width": 234,
        "height": 156,
        "size": 6.12,
        "url": "/uploads/thumbnail_littlebox_strapi_suite_t_shirt_3f9a1c.webp"
      },
      "small": { "...": "..." },
      "medium": { "...": "..." },
      "large": { "...": "..." }
    },
    "hash": "littlebox_strapi_suite_t_shirt_3f9a1c",
    "ext": ".webp",
    "mime": "image/webp",
    "size": 84.37,
    "url": "/uploads/littlebox_strapi_suite_t_shirt_3f9a1c.webp",
    "previewUrl": null,
    "provider": "local",
    "provider_metadata": null,
    "createdAt": "2026-11-27T10:15:00.000Z",
    "updatedAt": "2026-11-27T10:15:00.000Z"
  }
}
```

In gallery mode, the value is a list of images in the order you set in the admin. An empty gallery is `null` or `[]`.

```json theme={null}
{
  "gallery": [
    { "id": 42, "url": "/uploads/littlebox_strapi_suite_t_shirt_3f9a1c.webp", "...": "..." },
    { "id": 43, "url": "/uploads/littlebox_strapi_suite_mug_8d2e4b.webp", "...": "..." }
  ]
}
```

The value is a copy taken when you saved the document. If you change a file directly in the Media Library, for
example its alt text, the field keeps the old value. Edit the alt text in the field instead.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.