Aspect Ratio
hextaui/aspect-ratioFreeComponent
Maintains a fixed ratio for child content.
Live preview
live · rendered by the registry
Rendered by HextaUI on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://hextaui.com/r/aspect-ratio.jsonSource
1"use client";23import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";4import * as React from "react";5import { cn } from "@/lib/utils";67type AspectRatioProps = React.ComponentProps<typeof AspectRatioPrimitive.Root>;89const AspectRatio = React.forwardRef<10 React.ComponentRef<typeof AspectRatioPrimitive.Root>,11 AspectRatioProps12>(function AspectRatio({ className, ...props }, ref) {13 return (14 <AspectRatioPrimitive.Root15 className={cn("touch-manipulation", className)}16 data-slot="aspect-ratio"17 ref={ref}18 {...props}19 />20 );21});2223export { AspectRatio };
What it pulls in
npm packages
Files it writes
More from HextaUI
All 139 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | HextaUI | Components | Free | 1 dep | |
| AI Chat Historyai-chat-history | HextaUI | Components | Free | no deps | |
| AI Citationsai-citations | HextaUI | Components | Free | no deps | |
| AI Conversationai-conversation | HextaUI | Components | Free | no deps | |
| AI Error Handlerai-error-handler | HextaUI | Components | Free | no deps | |
| AI File Uploadai-file-upload | HextaUI | Components | Free | no deps | |
| AI Messageai-message | HextaUI | Components | Free | 4 deps | |
| AI Model Selectorai-model-selector | HextaUI | Components | Free | no deps |
