Skip to main content
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:
Step 8: Go to the Advanced settings tab if you need these settings: Step 9: Click “Finish”, then click “Save”.

How the size settings work

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.
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.
  • Move the image: drag it. The arrow keys move it 1 px, or 10 px with Shift.
  • 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: 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.
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:

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:
In gallery mode, the value is a list of images in the order you set in the admin. An empty gallery is null or [].
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.