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.
Prop | Type | Default |
---|---|---|
as_child | MaybeProp<bool> | false |
ratio | MaybeProp<f64> | 1.0 |