Skip to content

Aspect Ratio ​

Displays content within a desired ratio.

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

Ratios ​

Approximate web preview — the HarmonyOS rendering is the reference.

API ​

Extracted from the @Param / @Event / @BuilderParam declarations in the library sources.

SAspectRatio ​

shadcn-vue AspectRatio: a full-width box whose height follows ratio (width / height). Children are centred; give them width('100%').height('100%') to fill (e.g. an Image with objectFit(ImageFit.Cover)).

PropTypeDefaultDescription
rationumber1width / height, e.g. 16 / 9.
modifierAttributeModifier<StackAttribute>new SparkNoopModifier<StackAttribute>()

Slots: children (trailing closure)

MIT Licensed