Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

AspectRatio

Keep product media in a predictable frame.

Preview

Live preview

Changes apply to this preview only.

Pimolu Studio headphones with the p emblem

Pimolu Studio

New

The media reserves its space, so the card does not jump when the image arrives.

€129

Video embed

16 / 9 matches the default video frame.

Video placeholderiframe, video or canvas fills the box

Gallery tile

A square tile keeps a grid of different products aligned.

Pimolu Studio, square crop

Everyday collection

Square media is predictable in a masonry or a carousel.

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.

Ratios

The default is 16 / 9; any positive finite number works. Invalid values fall back to the default.

Open preview

Non-media content

The content wrapper is a grid, so a non-image child stretches to the reserved area.

Open preview

Invalid fallbacks

Zero, negative and non-finite values keep the 16 / 9 default instead of collapsing the box.

Open preview

Usage

Choose a ratio appropriate to the media without distorting its 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.

PimoluAspectRatioProps

Type source
PimoluAspectRatioProps public API
NameTypeDefaultDescription
asElementType | undefined`div`Element rendered by the outer box. Defaults to `div`.
rationumber | undefined`16 / 9`Width divided by height. Defaults to `16 / 9`. Invalid or non-positive values fall back to the default.
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.
childrenReactNode—Standard React/HTML attribute.
onChangeChangeEventHandler<HTMLElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLElement> | undefined—Standard React/HTML attribute.
as

ElementType | undefined

Default: `div`

Element rendered by the outer box. Defaults to `div`.

ratio

number | undefined

Default: `16 / 9`

Width divided by height. Defaults to `16 / 9`. Invalid or non-positive values fall back to the default.

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.

children

ReactNode

No default extracted.

Standard React/HTML attribute.

onChange

ChangeEventHandler<HTMLElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLElement> | undefined

No default extracted.

Standard React/HTML attribute.

Accessibility

  • Provide image alternatives and retain a usable layout if the image fails.
Read the accessibility guide →