Skip to content

PhoenixKit 2.33.0: A featured image component for modules

PhoenixKit 2.33.0 gives modules a ready control for an item’s main image, such as an order or product picture, a logo or an avatar. On its own it changes little on a running site; modules that adopt it get the same control everywhere.

Featured image

The new FeaturedImage component shows the image’s thumbnail with an actions menu that is always visible, so it works on touch screens: Change and Remove, plus View when the module offers a preview. Change opens the media picker, narrowed to the item’s own folder and its subfolders, and files uploaded from there are filed in that folder. A module whose item has no folder yet can have one created on the first click. Without a folder, choosing is not offered at all, so the picker never browses the whole library.

The component saves nothing itself. The module that uses it checks permissions, stores the choice where it likes, and passes the new image back. It can be placed inside an existing form, and a read-only version shows only the thumbnail.

Missing and hidden images

A pointer to something that is not a live image, such as a trashed or deleted file or a failed upload, is drawn as a missing placeholder whose menu still offers Remove, so a broken pointer can always be cleared. Read-only viewers see nothing for it rather than a warning they cannot act on. The component also refuses the hidden unedited original that an edited image keeps, even if a client sends its id.

Smaller changes

Row menus in tables can have a larger, touch-sized ⋮ button. A preview card without any image or file now shows a placeholder instead of collapsing to a bare list of fields.

Upgrading

No migration and no configuration.

Full release notes: PhoenixKit 2.33.0

2.33.0 · 20 September 2026

Added

  • PhoenixKitWeb.Components.FeaturedImage — a LiveComponent for one entity’s main image (order/product image, logo, avatar): a thumbnail, an always-visible Change / Remove menu that works on touch screens, and the whole media-picker protocol behind it. It is controlled and writes nothing: the host handles {FeaturedImage, id, {:set_featured, uuid | nil}}, authorizes, persists and passes the new uuid back. picker_scope is {:folder, uuid}, :lazy (folder created on the first click) or nil. The picker renders through a portal, so the control is safe inside a host <.form>. Guide: “FeaturedImage Component” in the core-components guide.
  • table_row_menu takes trigger_size ("xs" default, "sm", "md") for a touch-sized ⋮ trigger. The size class is replaced, not appended — btn-xs sorts after btn-sm in the built CSS and would win.

Changed

  • A preview_card with no media shows a placeholder instead of collapsing to a bare list of fields.

Fixed

  • FeaturedImage refuses a system-managed file (an edited image’s hidden unedited original). The picker never lists one, but the chosen uuid comes from the client, and such a row is a live image that is never served.

PhoenixKit 2.33.0. Install or update: {:phoenix_kit, "~> 2.33"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.