Skip to content

Thumbnail

@astryxdesign/core v0.7.1 · Thumbnail

Props ​

NameTypeDefaultDescription
srcstring-Image URL. A failed load falls back to the placeholder for that src.
altstring-Alternative text for the image.
labelstring-Accessible name. Not drawn. Used by the tooltip and the remove button.
isLoadingbooleanfalseSkeleton when there is no src. Spinner over the image when there is one.
isDisabledbooleanfalseFades the thumbnail and ignores click and remove.
showRemoveOn'always' | 'hover''hover'When the remove button is visible. hover also reveals it on keyboard focus, and keeps it visible for a coarse pointer.

Events ​

NamePayloadWhen
clickMouseEventThe preview is activated and the thumbnail is neither disabled nor loading.
removeMouseEventThe remove button is used. The button is only rendered when this listener is present.

Theming ​

The square is 64px with the element radius and a neutral fill. A 1px border is inset. The placeholder glyph is 24px. The remove button is 20×20, inset by one spacing step from the top and end edges, with an overlay fill and an on-dark icon. A coarse pointer expands the hit area by 2px. Disabled opacity is 0.5.