• © Goverland Inc. 2026
  • v1.0.8
  • Privacy Policy
  • Terms of Use
zDAO SKY TesterzDAO SKY Testerby0x13fc7bcCa25BC0bAB1c9cbEc2Ea2a254F4357f6E0x13fc…7f6E

Moving Forward Phase 1 measures now in effect; PEI COVID-19 update Thursday, February 17

Voting ended almost 4 years agoSucceeded

alt text

React Srcset Images for Crystallize

A React package to output an img tag with different source variations from Crystallize using srcset. Use this to easily build responsive images powered by the Crystallize headless commerce service.

And don't forget: react image sizes attribute for fast ecommerce.

Demo

Demo

Install

yarn add @crystallize/react-image

Use

import { Image } from '@crystallize/react-image';

const imageFromCrystallize = {
    url: '...',
    variants: [...]
}

<Image
    {...imageFromCrystallize}
    sizes="(max-width: 700px) 90vw, 700px"
/>

Render child function

const imageFromCrystallize = {
    url: '...',
    variants: [...],
    altText: ''
}

<Image
    {...imageFromCrystallize}
    sizes="(max-width: 700px) 90vw, 700px"
>
  {({
      src,
      srcSet,
      srcSetWebp,
      useAvif,
      useWebP,
      sizes,
      width,
      height,
      loading,
      alt,
      originalFileExtension,
      ...rest
    }) => {
      // Roll your own render
      return (
          <picture {...rest}>
            {useAvif && (
                <source srcSet={srcSetAvif} type="image/avif" sizes={sizes} />
            )}
            {useWebP && (
                <source srcSet={srcSetWebp} type="image/webp" sizes={sizes} />
            )}
            {srcSet.length > 0 && (
                <source
                    srcSet={srcSet.join(", ")}
                    src={std[0].url}
                    type={`image/${originalFileExtension}`}
                    sizes={sizes}
                />
            )}

            <img src={src} width={width} height={height} loading={loading} alt={alt} />
        </picture>
      )
  }}
</Image>

Off-Chain Vote

Y 4
1 zSKY50%
N 4
1 zSKY50%
Download mobile app to vote

Timeline

May 30, 2022Proposal created
May 30, 2022Proposal vote started
Jun 01, 2022Proposal vote ended
Oct 26, 2023Proposal updated