Figma
Star457
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>
);

ratio RequiredRequired

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

Type
string

To help us improve this site, we use tools that set cookies. The data gathered by these tools is anonymized. If you reject the use of cookies, no analytics service will be initiated.