{"id":15175323,"url":"https://github.com/crystallizeapi/react-image","last_synced_at":"2025-10-01T12:31:10.979Z","repository":{"id":29639904,"uuid":"122318157","full_name":"CrystallizeAPI/react-image","owner":"CrystallizeAPI","description":"A React package to output an img tag with different source variations from Crystallize","archived":true,"fork":false,"pushed_at":"2023-02-23T23:17:21.000Z","size":4111,"stargazers_count":7,"open_issues_count":10,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-27T12:22:28.155Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"react-image-storybook.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CrystallizeAPI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-21T09:49:19.000Z","updated_at":"2023-02-23T23:26:58.000Z","dependencies_parsed_at":"2024-09-03T09:31:33.544Z","dependency_job_id":"c50a519c-1a37-465b-acce-fa868bb95834","html_url":"https://github.com/CrystallizeAPI/react-image","commit_stats":{"total_commits":140,"total_committers":10,"mean_commits":14.0,"dds":"0.22857142857142854","last_synced_commit":"7170e4c7bc94655387a539d6817c1474c161be77"},"previous_names":[],"tags_count":67,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrystallizeAPI%2Freact-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrystallizeAPI%2Freact-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrystallizeAPI%2Freact-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrystallizeAPI%2Freact-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrystallizeAPI","download_url":"https://codeload.github.com/CrystallizeAPI/react-image/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219875436,"owners_count":16554678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-27T12:22:44.537Z","updated_at":"2025-10-01T12:31:10.660Z","avatar_url":"https://github.com/CrystallizeAPI.png","language":"TypeScript","readme":"# Deprecation Notice\nThis package has been deprecated and is no longer maintained. It has been moved to a new repository and is now part of a larger project. Please update your dependencies to use the new package instead.\n\nNew package repository: https://github.com/CrystallizeAPI/reactjs-components\n\nThank you for using this package!\n\n---\n\n![alt text](https://raw.githubusercontent.com/CrystallizeAPI/react-image/HEAD/media/logo.png 'An illustration of an atom')\n\n# React Srcset Images for Crystallize\n\nA 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](https://crystallize.com/).\n\nAnd don't forget:\n[react image sizes attribute for fast ecommerce](https://crystallize.com/blog/react-image-sizes-attribute-for-fast-ecommerce).\n\n## Demo\n\n[Demo](https://react-image.milliseconds.io/)\n\n## Install\n\n```\nyarn add @crystallize/react-image\n```\n\n## Use\n\n```\nimport { Image } from '@crystallize/react-image';\n\nconst imageFromCrystallize = {\n    url: '...',\n    variants: [...]\n}\n\n\u003cImage\n    {...imageFromCrystallize}\n    sizes=\"(max-width: 700px) 90vw, 700px\"\n/\u003e\n```\n\n## Render child function\n\n```\nconst imageFromCrystallize = {\n    url: '...',\n    variants: [...],\n    altText: ''\n}\n\n\u003cImage\n    {...imageFromCrystallize}\n    sizes=\"(max-width: 700px) 90vw, 700px\"\n\u003e\n  {({\n      src,\n      srcSet,\n      srcSetWebp,\n      useAvif,\n      useWebP,\n      sizes,\n      width,\n      height,\n      loading,\n      alt,\n      originalFileExtension,\n      ...rest\n    }) =\u003e {\n      // Roll your own render\n      return (\n          \u003cpicture {...rest}\u003e\n            {useAvif \u0026\u0026 (\n                \u003csource srcSet={srcSetAvif} type=\"image/avif\" sizes={sizes} /\u003e\n            )}\n            {useWebP \u0026\u0026 (\n                \u003csource srcSet={srcSetWebp} type=\"image/webp\" sizes={sizes} /\u003e\n            )}\n            {srcSet.length \u003e 0 \u0026\u0026 (\n                \u003csource\n                    srcSet={srcSet.join(\", \")}\n                    src={std[0].url}\n                    type={`image/${originalFileExtension}`}\n                    sizes={sizes}\n                /\u003e\n            )}\n\n            \u003cimg src={src} width={width} height={height} loading={loading} alt={alt} /\u003e\n        \u003c/picture\u003e\n      )\n  }}\n\u003c/Image\u003e\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystallizeapi%2Freact-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrystallizeapi%2Freact-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrystallizeapi%2Freact-image/lists"}