{"id":13723706,"url":"https://github.com/PaulMaly/svelte-content-loader","last_synced_at":"2025-05-07T17:31:04.205Z","repository":{"id":58946555,"uuid":"168408523","full_name":"PaulMaly/svelte-content-loader","owner":"PaulMaly","description":"Svelte Content Loader for Svelte 3","archived":false,"fork":false,"pushed_at":"2023-02-14T12:48:28.000Z","size":22,"stargazers_count":155,"open_issues_count":3,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-07T13:17:46.342Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Svelte","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PaulMaly.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-30T20:15:19.000Z","updated_at":"2024-08-23T15:23:10.000Z","dependencies_parsed_at":"2022-09-17T07:22:23.476Z","dependency_job_id":null,"html_url":"https://github.com/PaulMaly/svelte-content-loader","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/PaulMaly%2Fsvelte-content-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulMaly%2Fsvelte-content-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulMaly%2Fsvelte-content-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PaulMaly%2Fsvelte-content-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PaulMaly","download_url":"https://codeload.github.com/PaulMaly/svelte-content-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224627950,"owners_count":17343274,"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-08-03T01:01:44.675Z","updated_at":"2024-11-14T13:30:48.193Z","avatar_url":"https://github.com/PaulMaly.png","language":"Svelte","funding_links":[],"categories":["components and libraries","HTML"],"sub_categories":["async loading"],"readme":"# Svelte Content Loader for Svelte 3\n\n[![NPM version](https://img.shields.io/npm/v/svelte-content-loader.svg?style=flat)](https://www.npmjs.com/package/svelte-content-loader) [![NPM downloads](https://img.shields.io/npm/dm/svelte-content-loader.svg?style=flat)](https://www.npmjs.com/package/svelte-content-loader)\n\nSVG component to create placeholder loading, like Facebook cards loading.\n\n![preview](https://user-images.githubusercontent.com/4838076/34308760-ec55df82-e735-11e7-843b-2e311fa7b7d0.gif)\n\n## Features\n\nThis is a Svelte port for [vue-content-loader](https://github.com/egoist/vue-content-loader).\n\n- Completely customizable: you can change the colors, speed and sizes.\n- You can use it right now: there are a lot of presets already.\n- Performance:\n  - Tree-shakable and highly optimized bundle.\n  - Pure SVG, so it's works without any javascript, canvas, etc.\n  - Vanilla JS components.\n\n## Install\n\n```bash\nnpm i svelte-content-loader --save\n```\n\n```bash\nyarn add svelte-content-loader\n```\n\nCDN: [UNPKG](https://unpkg.com/svelte-content-loader/) | [jsDelivr](https://cdn.jsdelivr.net/npm/svelte-content-loader/) (available as `window.ContentLoader`)\n\n## Usage\n\n```html\n\u003cContentLoader/\u003e\n\n\u003cscript\u003e\nimport ContentLoader from 'svelte-content-loader';\n\u003c/script\u003e\n```\n\n### Built-in loaders\n\n```js\nimport {\n  FacebookLoader,\n  CodeLoader,\n  BulletListLoader,\n  InstagramLoader,\n  ListLoader\n} from 'svelte-content-loader'\n```\n\n`ContentLoader` is a meta loader while other loaders are just higher-order components of it. By default `ContentLoader` only displays a simple rectangle, here's how you can use it to create custom loaders:\n\n```html\n\u003cContentLoader\u003e\n  \u003crect x=\"0\" y=\"0\" rx=\"3\" ry=\"3\" width=\"250\" height=\"10\" /\u003e\n  \u003crect x=\"20\" y=\"20\" rx=\"3\" ry=\"3\" width=\"220\" height=\"10\" /\u003e\n  \u003crect x=\"20\" y=\"40\" rx=\"3\" ry=\"3\" width=\"170\" height=\"10\" /\u003e\n  \u003crect x=\"0\" y=\"60\" rx=\"3\" ry=\"3\" width=\"250\" height=\"10\" /\u003e\n  \u003crect x=\"20\" y=\"80\" rx=\"3\" ry=\"3\" width=\"200\" height=\"10\" /\u003e\n  \u003crect x=\"20\" y=\"100\" rx=\"3\" ry=\"3\" width=\"80\" height=\"10\" /\u003e\n\u003c/ContentLoader\u003e\n```\n\nThis is also how [ListLoader](./src/ListLoader.svelte) is created.\n\nIf you are **not** using using es6, instead of importing add \n\n```html\n\u003cscript src=\"/path/to/svelte-content-loader/index.js\"\u003e\u003c/script\u003e\n```\n\njust before closing body tag. \n\n## API\n\n### Props\n\n|Name|Type|Default|Description|\n|---|---|---|---|\n|width|number|`400`||\n|height|number|`130`||\n|speed|number|`2`||\n|preserveAspectRatio|string|`'xMidYMid meet'`||\n|primaryColor|string|`'#f9f9f9'`||\n|secondaryColor|string|`'#ecebeb'`||\n|uniqueKey|string|`randomId()`|Unique ID, you need to make it consistent for SSR|\n|animate|boolean|`true`||\n|baseUrl|string|empty string|Required if you're using \u003cbase url=\"/\" /\u003e in your \u003chead/\u003e. Defaults to an empty string. This prop is common used as: \u003cContentLoader bind:baseUrl={pathname} /\u003e which will fill the SVG attribute with the relative path.\n|primaryOpacity|number|`1`|Background opacity (0 = transparent, 1 = opaque) used to solve an issue in Safari|\n|secondaryOpacity|number|`1`|Background opacity (0 = transparent, 1 = opaque) used to solve an issue in Safari|\n\n\n## Credits\n\nThis is basically a Svelte port for [vue-content-loader](https://github.com/egoist/vue-content-loader).\n\n## License\n\nMIT \u0026copy; [PaulMaly](https://github.com/PaulMaly)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPaulMaly%2Fsvelte-content-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPaulMaly%2Fsvelte-content-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPaulMaly%2Fsvelte-content-loader/lists"}