Pallas UI
DocsComponents
Core Concepts
    • Introduction
    • Getting Started
    • Theming
    • Color Tokens
    • Spacing & Sizing
    • Layout Guide
    • AspectRatio
    • Box
    • Flex
    • Grid
    • Shapes
Previews
    • Accordion
    • Alert
    • Avatar
    • Badge
    • Breadcrumb
    • Button
    • Carousel
    • Checkbox
    • Combobox
    • Command
    • Date Picker
    • Form
    • Input
    • Input OTP
    • Label
    • MenuBar
    • Modal
    • Popover
    • Progress
    • Radio Group
    • ScrollArea
    • Segmented
    • Select
    • Separator
    • Sheet
    • Sidebar
    • Skeleton
    • Slider
    • Spinner
    • Steps
    • Switch
    • Tabs
    • Textarea
    • Toast
    • Tooltip
    • TreeView
    • Typography
  1. Layout
  2. AspectRatio

AspectRatio

A component that maintains a specific aspect ratio, regardless of the width.

This is particularly useful for images, videos, and other media content.

Loading preview...

Usage

import { AspectRatio } from '@styled-system/jsx'
<AspectRatio ratio={16 / 9} w="100%" maxW="500px">
  <img src="your-image.jpg" alt="Example" style={{ objectFit: 'cover' }} />
</AspectRatio>

Properties

AspectRatio accepts all the common layout properties plus:

NameTypeDefaultDescription
rationumber1The aspect ratio to maintain (width/height)

Examples

With Image

Loading preview...

Responsive

Loading preview...

Built with ❤️ by the carbonteq team. The source code is available on GitHub.

© 2026 Pallas UI. All rights reserved.

16:9 Aspect Ratio
Nature landscape
Responsive Aspect Ratio(Changes at different breakpoints)