{"id":15385986,"url":"https://github.com/alstonchan/image","last_synced_at":"2026-03-27T04:50:20.105Z","repository":{"id":64729259,"uuid":"544027646","full_name":"AlstonChan/Image","owner":"AlstonChan","description":"A simple React image component","archived":false,"fork":false,"pushed_at":"2024-08-31T06:18:26.000Z","size":2273,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-19T01:35:21.227Z","etag":null,"topics":["image","react-component","responsive","typescript","vitejs"],"latest_commit_sha":null,"homepage":"https://image-react-packages.onrender.com","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/AlstonChan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2022-10-01T12:56:03.000Z","updated_at":"2024-06-29T03:25:51.000Z","dependencies_parsed_at":"2024-05-14T11:47:37.190Z","dependency_job_id":"8a9f3b36-9dc1-476d-943e-f8eb6a38cac2","html_url":"https://github.com/AlstonChan/Image","commit_stats":{"total_commits":32,"total_committers":2,"mean_commits":16.0,"dds":0.03125,"last_synced_commit":"e691f9bc382b6fe7188c20fe52994c7931859f6a"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlstonChan%2FImage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlstonChan%2FImage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlstonChan%2FImage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlstonChan%2FImage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlstonChan","download_url":"https://codeload.github.com/AlstonChan/Image/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241150605,"owners_count":19918353,"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":["image","react-component","responsive","typescript","vitejs"],"created_at":"2024-10-01T14:46:54.932Z","updated_at":"2025-12-28T05:03:05.567Z","avatar_url":"https://github.com/AlstonChan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Image Component\n\nA simple, easy to use image component for React. (Compatible with NextJs)\n\n## Installation\n\n  ```bash\n  npm install @chan_alston/image@latest --save\n  ```\n\n## `Image` usage\n\n```javascript\nimport styles from \"./image.module.css\";\n\nimport React from \"react\";\nimport Image from \"@chan_alston/image\";\n\nimport myImg from \"../public/myImg.jpg\";\nimport myImgSmall from \"../public/myImgSmall.jpg\";\nimport myImgMedium from \"../public/myImgMedium.jpg\";\nimport myImgBig from \"../public/myImgBig.jpg\";\n\nconst ImageComponent = ({ image }) =\u003e (\n  \u003cfigure\u003e\n    \u003cImage\n      src={myImg} \n      alt=\"my image\"\n      w=\"100px\"  // w stands for width\n      h=\"100px\" // h stands for height\n      className={`${styles.myImage} ${styles.imgContainer} img`}\n      srcSet={`${myImgSmall} 500w,\n              ${myImgMedium} 900w,\n              ${qmyImgBig} 1400w`}\n      sizes=\"(min-width: 66em) 33vw,\n            (min-width: 44em) 50vw,\n            100vw\"\n      responsive  // default to true\n      priority={false} // default to false\n      placeholder=\"https://via.placeholder.com/512\"\n    /\u003e\n    \u003cfigcaption\u003eThis is my image\u003c/figcaption\u003e\n  \u003c/figure\u003e\n);\n\nexport default ImageComponent;\n```\n\n### Properties of `Image`\n\n| Properties  | Type                      | Required  | Default Value |\n|-------------|:-------------------------:|:---------:|:-------------:|\n| src         | String or StaticImageData | true      |               |\n| alt         | String                    | true      |               |\n| w           | String or Number          | false     |               |\n| h           | String or Number          | false     |               |\n| className   | String                    | false     |               |\n| srcSet      | String                    | false     |               |\n| sizes       | String                    | false     |               |\n| responsive  | Boolean                   | false     | true          |\n| priority    | Boolean                   | false     | false         |\n| imgRef      | React.MutableRefObject    | false     | null          |\n| style       | CSSProperties             | false     | {}            |\n| placeholder | String or StaticImageData | false     |               |\n\n### Notes\n\n- When `w`(width) and/or `h`(height) is set, `responsive` is set to **false** by default, unless explicitly specify with `responsive`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falstonchan%2Fimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falstonchan%2Fimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falstonchan%2Fimage/lists"}