DocsBlog

Get Started

Components

Data Grid

Signals

Styling

Theming

↑↓Navigate
↵Select
EscClose
  • 1.8.0

  • Day

    Night

    Preview

    Switch mode
  • cerberus

    acheron

    elysium

    oceanus

Get Started
Components
Data Grid
Signals
Styling
Theming

Concepts

OverviewCompositionCerberus ContextTesting

Layout

Aspect RatioBleedBoxCenterContainerContainer QueryDividerFlexFloatGridGroupLink OverlayScrollableStackWrap

Components

AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTA ModalDate PickerDialogFieldFieldsetFile UploaderIconButtonInputLoading StatesMarqueeMenuNotificationsNumber InputPaginationPin InputPopoverProgress IndicatorsPrompt ModalRadioRatingSelectSliderSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltip

Utilities

Client OnlyDownload TriggerEnvironmentFeature FlagsFocus TrapForFormat ByteFormat NumberFormat Relative TimeFormat Relative TimeFrameHighlightJSON Tree ViewLocalePortalPresenceShowSwapsplitPropsTheme

Aspect Ratio

Used to embed responsive videos and maps, etc.

  • Panda
View as Markdown
Open this page in Markdown
Anthropic
Open in Claude
Ask questions about this page
OpenAI
Open in ChatGPT
Ask questions about this page

Import

import { AspectRatio } from 'styled-system/jsx'

Usage

Loading example...

Image

Here's how to embed an image that has a 4 by 3 aspect ratio.

Loading example...

Video

To embed a video with a specific aspect ratio, use an iframe with src pointing to the link of the video.

Failed to load code file: components/aspect-ratio/video.demo.tsx

Google Map

Here's how to embed a responsive Google map using AspectRatio.

Loading example...

Responsive

Here's an example of applying a responsive aspect ratio to a box.

Loading example...

Props

These props can be passed to the AspectRatio component in addition to style and factory props.

PropTypeDescription
ratioConditionalValue<number>The aspect ratio of the Box. Common values are: 21/9, 16/9, 9/16, 4/3, 1.85/1

On this page

  • Import
  • Usage
    • Image
    • Video
    • Google Map
    • Responsive
  • Props
Edit this page on Github
A fiery cerberus
Box