Sections
Get Started
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
- Form
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Kbd
- Label
- Menubar
- Native Select
- Navigation Menu
- Pagination
- Pin Input
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Stepper
- Switch
- Table
- Tabs
- Tags Input
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
- Typography
Forms
<script setup lang="ts">
import { AspectRatio } from '@/components/ui/aspect-ratio'
</script>
<template>
<AspectRatio :ratio="16 / 9" class="bg-muted rounded-lg">
<img
src="https://images.unsplash.com/photo-1588345921523-c2dcdb7f1dcd?w=800&dpr=2&q=80"
alt="Photo by Drew Beamer"
fill
class="h-full w-full rounded-lg object-cover dark:brightness-[0.2] dark:grayscale"
>
</AspectRatio>
</template>Installation
pnpm dlx shadcn-vue@latest add aspect-ratio
Usage
<script 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>