Letterboxes are useful if you have some source media which is larger than
the area you want to display it in. For instance, you might have a really
tall image and want it to be displayed in a neatly cropped square. While the
ideal solution to this problem is to update the source image, this might not
always be possible for either cost or performance reasons.

Letterbox should be used in situations where you would otherwise use the
CSS property background-size: cover.

Props

Name
Type
Default
contentAspectRatio
Required
number
-

Proportional relationship between width and height of element

height
Required
number
-

Desired final height of element

width
Required
number
-

Desired final width of element

children
React.Node
-

Tall content (564:806)

tall

Wide content (564:517)

wide

Square content (1:1)

square

Square content (1:1) in a vertical frame

square

Square content (1:1) in a horizontal frame

square