{"id":23782286,"url":"https://github.com/sjafferi/svelte-images","last_synced_at":"2025-09-06T01:32:34.079Z","repository":{"id":44006791,"uuid":"236859446","full_name":"sjafferi/svelte-images","owner":"sjafferi","description":"A Svelte component for displaying images","archived":false,"fork":false,"pushed_at":"2022-12-05T05:54:51.000Z","size":18421,"stargazers_count":21,"open_issues_count":14,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-16T06:12:09.326Z","etag":null,"topics":["svelte","svelte-components","svelte-v3","sveltejs"],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/sjafferi.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}},"created_at":"2020-01-28T22:47:52.000Z","updated_at":"2024-05-19T18:43:14.000Z","dependencies_parsed_at":"2023-01-24T02:00:51.336Z","dependency_job_id":null,"html_url":"https://github.com/sjafferi/svelte-images","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjafferi%2Fsvelte-images","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjafferi%2Fsvelte-images/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjafferi%2Fsvelte-images/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjafferi%2Fsvelte-images/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjafferi","download_url":"https://codeload.github.com/sjafferi/svelte-images/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232076647,"owners_count":18469236,"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":["svelte","svelte-components","svelte-v3","sveltejs"],"created_at":"2025-01-01T12:14:09.030Z","updated_at":"2025-01-01T12:14:09.455Z","avatar_url":"https://github.com/sjafferi.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# svelte-images\nA Svelte component for displaying images\n\n[Demo](https://sjafferi.github.io/svelte-images/)\n\n## Installation\n\nInstall svelte-images\n   `yarn add svelte-images`\n\n## Examples\n\n### Gallery + Carousel\n\n```html\n\u003cscript\u003e\n  import { Images } from \"svelte-images\";\n  const images = [\n    {\n      src: \"/borat.png\"\n    },\n    {\n      src: \"/borat.png\"\n    },\n    {\n      src: \"/borat.png\"\n    },\n    {\n      src: \"/borat.png\"\n    },\n    {\n      src: \"/borat.png\"\n    },\n    {\n      src: \"/borat.png\"\n    }\n  ];\n\u003c/script\u003e\n\n\u003cstyle\u003e\n  main {\n    height: 75vh;\n  }\n\u003c/style\u003e\n\n\u003cmain\u003e\n  \u003cImages {images} gutter={5} /\u003e\n\u003c/main\u003e\n```\n\n### Carousel only\n\n```html\n\u003cscript\u003e\n  import { Carousel } from \"svelte-images\";\n  const { Modal, open, close } = Carousel;\n\n  export let images = [];\n\n  const popModal = idx =\u003e\n    setTimeout(() =\u003e {\n      open(images, idx);\n    }, 0);\n\u003c/script\u003e\n\n\u003cstyle\u003e\n  .gallery {\n    display: flex;\n    flex-flow: row wrap;\n  }\n\n  img {\n    width: 100%;\n    height: auto !important;\n    cursor: pointer;\n  }\n  img:hover {\n    opacity: 0.5;\n    filter: grayscale(0.5) blur(1px);\n  }\n\u003c/style\u003e\n\n\u003cModal /\u003e\n\n\u003cdiv class=\"gallery\"\u003e\n  {#each images as image, i}\n    \u003cimg\n      {...image}\n      src={image.thumbnail || image.src}\n      alt={image.alt || ''}\n      on:click={() =\u003e popModal(i)} /\u003e\n  {/each}\n\u003c/div\u003e\n\n```\n\n### Images component properties\n\n| Property | Format                                                    | Default                                           |\n| -------- | --------------------------------------------------------- | ------------------------------------------------- |\n| images*  | `[{ src: \"...\", thumbnail: \"...\", ...\u003cimg\u003e attributes }]` | []                                                |  |\n| gutter   | number                                                    | 3                                                 |  |\n| numCols  | number                                                    | automatically set depending on width of container |\n  \n## Contributing\n\nFound a bug or have suggestions for improvement? We would love to hear from you!\n\nPlease open an issue to submit feedback or problems you come across.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjafferi%2Fsvelte-images","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjafferi%2Fsvelte-images","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjafferi%2Fsvelte-images/lists"}