AspectRatio
Constrains child content to a specific aspect ratio
Accessibility
- This component does not add meaning by itself; ensure child content supplies the required headings, labels, and landmarks.
- Only add landmark or region semantics when the section has a unique, meaningful label.
Styled quick start
Copy this entrypoint first. It includes the imports required to get the component on screen.
svelte
<script lang="ts">
import '@dryui/ui/themes/default.css';
import '@dryui/ui/themes/dark.css';
import { AspectRatio } from '@dryui/ui';
</script>
<AspectRatio>Content</AspectRatio> Import options
Root package
ts
import { AspectRatio } from '@dryui/ui' Per-component subpath
ts
import { AspectRatio } from '@dryui/ui/aspect-ratio' API
Props, CSS variables, and the public data attributes you can target when styling.
| Prop | Type | Description | Default | Required | Bindable |
|---|---|---|---|---|---|
| ratio | number | — | 16 / 9 | — | — |
| children | Snippet | Content rendered inside the component. | — | ✓ | — |