Components

Image Browser ​

Presentational picker for static icons and images supplied by the host — filesystem catalogs, icon sets, preview folders. Plugin Kit does not scan disks or filter file types; assign items or groups with already-resolved preview URLs or inline SVG.

label is display text (a curated name or a filename). value is what gets stored. Use this instead of Craft asset pickers when the value must travel with Project Config across environments.

Grid name visibility is controlled by label-mode / labelMode: tooltip (default — shared hover tip), inline (caption under each cell), or none (aria-label only).

Icon Mode ​

Default icon catalog — compact glyphs with label-mode="tooltip".

Icon Inline Labels ​

Captions under each glyph (label-mode="inline").

Icon No Labels ​

Names stay on aria-label only (label-mode="none").

Image Mode ​

Default image catalog — larger photo tiles with label-mode="tooltip".

Image Inline Labels ​

Captions under each photo (label-mode="inline").

Image No Labels ​

Names stay on aria-label only (label-mode="none").

Grouped Icons ​

Named groups, search, and scroll paging when a set is large. Use groups instead of a flat items list.

Grouped Images ​

Same groups API with mode="image" — headings sit above photo tiles.

Loading ​

Host-driven catalog warm. Set loading until items / groups arrive — the open panel shows a centered spinner (no loading copy). Pair with selected-label / selected-preview so the closed trigger still reflects a stored value before the catalog is ready.

API ​

Props ​

NameDescription
ariaLabelType string | null
Default null
customErrorCustom validation message; also settable via setCustomValidity().
Type string | null
Default null
defaultValueType string
disabledDisables the control and excludes it from constraint validation.
Type boolean
Default false
emptyMessageType string
Default No items match your query.
invalidType boolean
Default false
isInvalidAlias for invalid.
labelModeHow option names appear in the grid: tooltip (default), inline under each cell, or none (aria-label only).
Type PkImageBrowserLabelMode
Default tooltip
loadingHost-driven catalog warm / refresh. Shows a centered pk-spinner in the panel (no loading copy). Prefer this over inferring from empty items / groups — empty can also mean a filter miss or a genuinely empty catalog.
Type boolean
Default false
modeicon = compact glyph tiles; image = larger photo tiles.
Type PkImageBrowserMode
Default icon
nameName submitted with form data.
Type string | null
Default null
openType boolean
Default false
pageSizeItems drawn per group before scroll reveals the next page.
Type number
Default 96
placeholderType string
Default Choose…
placementType PkPopupPlacement
Default bottom-start
readonlyType boolean
Default false
readOnlyAlias for readonly.
requiredMarks the control as required for form submission.
Type boolean
Default false
searchPlaceholderType string
Default Search…
selectedLabelClosed-trigger label when value is set but not yet found in items / groups (e.g. catalog still loading).
Type string
selectedPreviewClosed-trigger preview for the same pre-catalog case as selected-label.
Type string
sideOffsetType number
Default 4
sizeType PkImageBrowserSize
Default default
valueType string
widthType PkImageBrowserWidth
Default auto
withClearShow a clear control when a value is selected.
Type boolean
Default true

Methods ​

NameDescription
checkValidity()Runs constraint validation without showing the browser UI.
hide(source: PkOverlaySource)—
reportValidity()Runs constraint validation and shows the browser UI when invalid.
resetValidity()Clears custom errors and re-syncs validity state.
setCustomValidity(message: string)Sets or clears a custom validation message.
show()—

Events ​

NameDescription
@change—
@input—
@pk-change—

Custom States ​

NameDescriptionCSS selector
disabledThe control is disabled.:state(disabled)
invalidThe control currently fails constraint validation.:state(invalid)
optionalThe control is not required.:state(optional)
requiredThe control is required.:state(required)
user-invalidInvalid after the user has interacted with the control.:state(user-invalid)
user-validValid after the user has interacted with the control.:state(user-valid)
validThe control currently passes constraint validation.:state(valid)

CSS Parts ​

NameDescriptionCSS selector
clear-buttonClear selection button (inside the control)::part(clear-button)
loadingCatalog-loading status region (spinner)::part(loading)
optionGrid cell button::part(option)
panelPopup panel shell::part(panel)
panel-bodyScrollable results region::part(panel-body)
panel-inputSearch input::part(panel-input)
panel-searchSearch field container::part(panel-search)
rootFilled control surface (trigger + clear + chevron)::part(root)
triggerOpens the panel (preview + label)::part(trigger)

Dependencies ​

This component registers the following elements when it loads.

NameDescription
pk-popupPositioned panel host.
pk-spinnerShown in the panel while loading is set.
pk-tooltipHover label when label-mode="tooltip".
Edit this page
Last updated: Sep 15, 2026, 1:09 PM