theme-ui#AspectRatio TypeScript Examples

The following examples show how to use theme-ui#AspectRatio. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ImageCarousel.tsx    From nextjs-shopify with MIT License 6 votes vote down vote up
ImageCarousel: React.FC<props> = ({
  images,
  onThumbnailClick,
  showZoom,
  currentSlide,
  ...imageProps
}) => {
  return (
    <AspectRatio ratio={Number(imageProps.height ) / Number(imageProps.width)}>
      <UntilInteraction
        skeleton={<Image src={images[0].src} {...imageProps} />}
      >
        <LazyCarousel
          images={images}
          showZoom={showZoom}
          currentSlide={currentSlide}
          onThumbnailClick={onThumbnailClick}
          {...imageProps}
        />
      </UntilInteraction>
    </AspectRatio>
  )
}