Skip to content

Aspect Ratio

Constrains children to a fixed width/height ratio.

Terminal window
npx github:truongnat/rnui#cli add aspect-ratio

or directly via the shadcn CLI:

Terminal window
npx shadcn add https://<registry-base>/r/nativewind/aspect-ratio.json # or /uniwind/
components/ui/aspect-ratio.tsx
// See the source file for the API:
  • components/ui/aspect-ratio.tsx

Installs together with: utils, theme