Skip to contentSkip to navigationSkip to topbar
Paste assistant Assistant
Figma
Star

Aspect Ratio

Version 10.1.0GithubStorybook

Installation

Installation page anchor
yarn add @twilio-paste/aspect-ratio - or - yarn add @twilio-paste/core
import {AspectRatio} from '@twilio-paste/core/aspect-ratio';
import {Box} from '@twilio-paste/core/box';

const Component = () => (
  <AspectRatio ratio="4:3">
    <Box position="absolute" top={0} right={0} bottom={0} right={0}>
      Test
    </Box>
  </AspectRatio>
);

AspectRatio

AspectRatio page anchor

ratio RequiredRequired

Determines the aspect ratio of the element. Use a colon-separated number pattern (width:height).

Type
string