Thumbnail
@astryxdesign/core v0.7.1 · Thumbnail
Props
| Name | Type | Default | Description |
|---|---|---|---|
src | string | - | Image URL. A failed load falls back to the placeholder for that src. |
alt | string | - | Alternative text for the image. |
label | string | - | Accessible name. Not drawn. Used by the tooltip and the remove button. |
isLoading | boolean | false | Skeleton when there is no src. Spinner over the image when there is one. |
isDisabled | boolean | false | Fades 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
| Name | Payload | When |
|---|---|---|
click | MouseEvent | The preview is activated and the thumbnail is neither disabled nor loading. |
remove | MouseEvent | The 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.