Aspect ratio preview
Reserve media space at a chosen width-to-height ratio before content loads.
free · Essentials · primitive
When to use
- Use it when a product interface needs reserve media space at a chosen width-to-height ratio before content loads.
- Choose it when the host application can supply the required state and keep business logic outside the presentation component.
Alternatives
- Choose tidal-button instead when press, loading, success and disabled states is the actual interface need, rather than aspect ratio.
Configure components.json and the @tidal-pro namespace before installing Pro components.
Installation
npx shadcn@latest add https://tidalui.com/r/aspect-ratio.jsonImport components/ui/tidal.css, components/ui/aspect-ratio.css. Wrap installed components in tidal-scope.
Preview

Minimal example
import"./components/ui/tidal.css";
import"./components/ui/aspect-ratio.css";
import{TidalAspectRatio}from"./components/ui/aspect-ratio";
export default()=><div className="tidal-scope"><TidalAspectRatio/></div>;API and props
TidalAspectRatio.clipboolean | undefinedCrop overflowing media. Leave false when content needs a visible focus ring.
TidalAspectRatio.rationumber | undefinedWidth divided by height. Invalid or nonpositive values use 16 / 9.
Complete usage
Full example, stylesheet imports, API and accessibility documentation
Gotchas
- Install the declared registry dependencies and render inside a tidal-scope with the foundation stylesheet loaded.