Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
- Typography
Get Started
@shadcn/react
@shadcn/helpers
Force UI registry
Utilities
Installation#
pnpm dlx shadcn@latest add @force-ui-vue/aspect-ratio
Usage#
<script setup lang="ts">
import { AspectRatio } from "@/components/ui/aspect-ratio"
</script>
<template>
<AspectRatio :ratio="16 / 9">
<img src="..." alt="Image" class="rounded-md object-cover" />
</AspectRatio>
</template>Examples#
Square#
A square aspect ratio component using the :ratio="1 / 1" prop. This is useful for displaying images in a square format.
Portrait#
A portrait aspect ratio component using the :ratio="9 / 16" prop. This is useful for displaying images in a portrait format.
API Reference#
AspectRatio#
The AspectRatio component displays content within a desired ratio.
| Prop | Type | Default | Required |
|---|---|---|---|
ratio | number | - | Yes |
class | string | - | No |
Deploy your shadcn/ui app on Vercel
Trusted by OpenAI, Sonos, Adobe, and more.
Vercel provides tools and infrastructure to deploy apps and features at scale.
Deploy to Vercel