Aspect Ratio
octane/aspect-ratioFreeComponent
octane publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by octane on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://raw.githubusercontent.com/octanejs/octane/main/packages/shadcn/registry/aspect-ratio.jsonSource
1// Base UI base aspect-ratio — presentational, no headless primitive in any base.2//3// UNVERIFIED PROVENANCE: derived from this package's React Aria base rather than transcribed4// from upstream's `bases/base-ui/ui/aspect-ratio.tsx`, which was not available at port time.5// `alert` was confirmed byte-identical between the two bases, which is why this is plausible —6// but it is not proof, and the bases DO diverge elsewhere. Diff the class strings against the7// upstream source before treating this as ported.8import { cn } from '@/lib/utils';9import type { DivProps } from '@/lib/types';1011export interface AspectRatioProps extends DivProps {12 ratio: number;13}1415export function AspectRatio({ ratio, className, ...props }: AspectRatioProps) @{16 <div17 data-slot="aspect-ratio"18 style={{19 '--ratio': ratio,20 } as Record<string, string | number>}21 className={cn('relative aspect-(--ratio)', className)}22 {...props}23 />24}
What it pulls in
Other registry items
Files it writes
More from octane
All 44 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | octane | Components | Free | 2 deps | |
| Alertalert | octane | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | octane | Components | Free | 1 dep | |
| Avataravatar | octane | Components | Free | 1 dep | |
| Badgebadge | octane | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | octane | Components | Free | 1 dep | |
| Buttonbutton | octane | Components | Free | 2 deps | |
| Cardcard | octane | Components | Free | no deps |
