Aspect Ratio

Displays content within a desired ratio.

Features

  • Accepts any custom ratio.

Installation

Install the component from your command line.

cargo add radix-leptos-aspect-ratio

Anatomy

Import the component.

use leptos::*;
use radix_leptos_aspect_ratio::*;

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

API Reference

Root

Contains the content you want to constrain to a given ratio.

PropTypeDefault
as_childMaybeProp<bool>false
ratioMaybeProp<f64>1.0

See Also