Aspect Ratio

Displays content within a desired ratio.

Photo by Drew Beamer

Anatomy

Import all parts and piece them together.

use leptos::prelude::*;
use singlestage::aspect_ratio::*;

#[component]
pub fn AspectRatioAnatomy() -> impl IntoView {
    view! { <AspectRatio /> }
}

API Reference

AspectRatio

Contains the contents of an aspect ratio component.

Custom Attributes
NameTypeDefaultDescription
ratiof641.0

The aspect ratio to use to display the child element.

Implements global attributes.