Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

Image

A product image inside a composed product card.

Preview

Live preview

Changes apply to this preview only.

Pimolu Studio product illustration

Pimolu Studio

In stock

A design-system starter with tokens, themes and cross-platform components.

€49Ships in 2–3 days
Pimolu p emblem on an indigo avatar

Jean Dupont

Design engineer

Recent work by Jean DupontLatest case study · 6 min read

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Cached images

Reuse the image shown below: hide and show another instance to check that cached files reveal their content, not a lasting skeleton.

Open preview

Aspect ratios

The wrapper reserves the box; the image fills it without shifting the page when it decodes.

Open preview

Object fit

A square box makes cover, contain, fill and scale-down visibly different.

Open preview

Usage

Use meaningful dimensions and a fallback appropriate to the content.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluImageProps

Type source
PimoluImageProps public API
NameTypeDefaultDescription
srcRequiredstring—Image URL.
altRequiredstring—Accessible alternative. Required by the type on purpose: a decorative image should opt in explicitly with `alt=""`.
fallbackSrcstring | undefined—Second URL tried when `src` fails, before showing the fallback. A failed fallback also ends in the fallback state.
fallbackReactNode—Custom content shown when the image cannot be displayed.
fitPimoluImageFit | undefined"cover"How the image fills its box. Defaults to "cover".
roundedPimoluImageRounded | undefined"md"Corner radius, using the shared radius tokens. Defaults to "md".
aspectRatiostring | number | undefined—Reserves the image box before it loads: a number (`16 / 9`) or a CSS string (`"16 / 9"`). Without it the intrinsic `width`/`height` keep the native aspect ratio and still avoid a layout shift.
showSkeletonboolean | undefinedtrueShows the animated placeholder while loading. Defaults to true.
containerClassNamestring | undefined—Class applied to the wrapping element.
containerStyleCSSProperties | undefined—Style applied to the wrapping element.
onLoad((event: SyntheticEvent<HTMLImageElement>) => void) | undefined—Called after the active source loads.
onError((event: SyntheticEvent<HTMLImageElement>) => void) | undefined—Called whenever a source fails, including the fallback source.
onChangeChangeEventHandler<HTMLImageElement, Element> | undefined—Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onClickMouseEventHandler<HTMLImageElement> | undefined—Standard React/HTML attribute.
srcRequired

string

No default extracted.

Image URL.

altRequired

string

No default extracted.

Accessible alternative. Required by the type on purpose: a decorative image should opt in explicitly with `alt=""`.

fallbackSrc

string | undefined

No default extracted.

Second URL tried when `src` fails, before showing the fallback. A failed fallback also ends in the fallback state.

fallback

ReactNode

No default extracted.

Custom content shown when the image cannot be displayed.

fit

PimoluImageFit | undefined

Default: "cover"

How the image fills its box. Defaults to "cover".

rounded

PimoluImageRounded | undefined

Default: "md"

Corner radius, using the shared radius tokens. Defaults to "md".

aspectRatio

string | number | undefined

No default extracted.

Reserves the image box before it loads: a number (`16 / 9`) or a CSS string (`"16 / 9"`). Without it the intrinsic `width`/`height` keep the native aspect ratio and still avoid a layout shift.

showSkeleton

boolean | undefined

Default: true

Shows the animated placeholder while loading. Defaults to true.

containerClassName

string | undefined

No default extracted.

Class applied to the wrapping element.

containerStyle

CSSProperties | undefined

No default extracted.

Style applied to the wrapping element.

onLoad

((event: SyntheticEvent<HTMLImageElement>) => void) | undefined

No default extracted.

Called after the active source loads.

onError

((event: SyntheticEvent<HTMLImageElement>) => void) | undefined

No default extracted.

Called whenever a source fails, including the fallback source.

onChange

ChangeEventHandler<HTMLImageElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onClick

MouseEventHandler<HTMLImageElement> | undefined

No default extracted.

Standard React/HTML attribute.

Accessibility

  • Write alternative text for informative imagery and avoid repeating adjacent text unnecessarily.
Read the accessibility guide →