AspectRatio() — ui Function Reference
Architecture documentation for the AspectRatio() function in aspect-ratio.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD 8cbf99bc_708a_d410_883e_d1018af51fc2["AspectRatio()"] 16509f6d_df11_7a3f_8e33_1517c702e919["aspect-ratio.tsx"] 8cbf99bc_708a_d410_883e_d1018af51fc2 -->|defined in| 16509f6d_df11_7a3f_8e33_1517c702e919 style 8cbf99bc_708a_d410_883e_d1018af51fc2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
apps/v4/examples/base/ui/aspect-ratio.tsx lines 3–20
function AspectRatio({
ratio,
className,
...props
}: React.ComponentProps<"div"> & { ratio: number }) {
return (
<div
data-slot="aspect-ratio"
style={
{
"--ratio": ratio,
} as React.CSSProperties
}
className={cn("relative aspect-(--ratio)", className)}
{...props}
/>
)
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does AspectRatio() do?
AspectRatio() is a function in the ui codebase, defined in apps/v4/examples/base/ui/aspect-ratio.tsx.
Where is AspectRatio() defined?
AspectRatio() is defined in apps/v4/examples/base/ui/aspect-ratio.tsx at line 3.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free