Getting Started
Components
- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Autocomplete
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Carousel
- Checkbox
- Collapsible
- Combobox
- Command
- Context Menu
- Data Table
- Date Picker
- Dialog
- Dropdown Menu
- Empty
- Field
- Form Field
- Hover Card
- Icon
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Label
- Menubar
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Resizable
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner (Toast)
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Tooltip
Stack
Aspect Ratio
Displays content within a desired ratio.

import { Component } from '@angular/core';
import { HlmAspectRatioImports } from '@spartan-ng/helm/aspect-ratio';
@Component({
selector: 'spartan-aspect-ratio-preview',
imports: [HlmAspectRatioImports],
template: `
<div class="max-w-xl overflow-hidden rounded-xl drop-shadow">
<div [hlmAspectRatio]="16 / 9">
<img alt="Mountain views" src="/assets/mountains.jpg" />
</div>
</div>
`,
})
export class AspectRatioPreview {}Installation
ng g @spartan-ng/cli:ui aspectratio
npx nx g @spartan-ng/cli:ui aspectratio
Usage
import { HlmAspectRatioImports } from '@spartan-ng/helm/aspect-ratio';<div class="max-w-xl overflow-hidden rounded-xl drop-shadow">
<div [hlmAspectRatio]="ratio">
<img alt="Mountain views" src="/mountains.jpg" />
</div>
</div>Helm API
HlmAspectRatio
Selector: [hlmAspectRatio]
Inputs
| Prop | Type | Default | Description |
|---|---|---|---|
| hlmAspectRatio | number | 1 | Aspect ratio of the element, defined as width / height. |
| class | ClassValue | - | - |
On This Page
Stop configuring. Start shipping.
Zerops powers spartan.ng and Angular teams worldwide.
One-command deployment. Zero infrastructure headaches.
Deploy with Zerops