Getting Started
Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Avatar
- Badge
- Banner
- Breadcrumb
- Bubble
- Button
- Button Group
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Command
- Collapsible
- Combobox
- Context Menu
- Data Table
- Date Picker
- Dialog
- Dropdown Menu
- Editor
- Input
- Input Group
- Label
- Loading Spinner
- Native Select
- Popover
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Steps
- Switch
- Tabs
- Textarea
- Tooltip
Patterns
Aspect Ratio
Displays content inside a box with a consistent width-to-height ratio.
16:9 content area
Component Code
<april:aspect-ratio ratio="16 / 9" class="w-full max-w-2xl overflow-hidden rounded-lg border bg-muted"> <div class="flex h-full items-center justify-center text-sm text-muted-foreground"> 16:9 content area </div></april:aspect-ratio>
Component Code
<april:aspect-ratio ratio="16 / 9" class="w-full max-w-2xl overflow-hidden rounded-lg border bg-muted"> <div class="flex h-full items-center justify-center text-sm text-muted-foreground"> 16:9 content area </div></april:aspect-ratio>
Pass a CSS aspect-ratio value through the
ratio attribute. The component uses its default slot for the content it constrains.
<april:aspect-ratio ratio="16 / 9"> <img src="/image.jpg" alt="A landscape" class="h-full w-full object-cover" /></april:aspect-ratio>
<april:aspect-ratio ratio="16 / 9"> <img src="/image.jpg" alt="A landscape" class="h-full w-full object-cover" /></april:aspect-ratio>
Publishing Views
Use the following command to publish this view:
php artisan april:publish aspect-ratio
php artisan april:publish aspect-ratio
php artisan april:publish --all
php artisan april:publish --all