styleKeyssquareImageContainer
Square Image Container
A Square Image Container creates a square element that centers a [FluidImage](/fluid-image inside it, and stretches the image to fill the width or height of the square as appropriate for the image's aspect ratio.
<GridContainer><Row><Column span={3}><Box backgroundColor="light-grey" p={4}><SquareImageContainer><FluidImage src="https://picsum.photos/400/200" /></SquareImageContainer></Box></Column><Column span={3}><Box backgroundColor="light-grey" p={4}><SquareImageContainer><FluidImage src="https://picsum.photos/400/200?q=1" /></SquareImageContainer></Box></Column><Column span={3}><Box backgroundColor="light-grey" p={4}><SquareImageContainer><FluidImage src="https://picsum.photos/400/200?q=2" /></SquareImageContainer></Box></Column><Column span={3}><Box backgroundColor="light-grey" p={4}><SquareImageContainer><FluidImage src="https://picsum.photos/400/200?q=3" /></SquareImageContainer></Box></Column></Row></GridContainer>
jsx
<SquareImageContainer><FluidImage src="my-image.png" alt="My Alt Text" /></SquareImageContainer>
<div class="square-image-container"><div class="square-image-container-inner"><img src="my-image.png" alt="My Alt Text" class="fluid-image" /></div></div>
Components
SquareImageContainer
SquareImageContainer
has no props of its own
All props are forwarded to the element specified in thecomponent
prop(default: <div/>
)
Guidelines
Square Image Container should only use Fluid Images and not Responsive Images.