{"id":15696863,"url":"https://github.com/dimensi/vue-sprintf-components","last_synced_at":"2026-05-19T05:39:45.880Z","repository":{"id":95814340,"uuid":"126537995","full_name":"dimensi/vue-sprintf-components","owner":"dimensi","description":"Render format string like sprintf with vue components","archived":false,"fork":false,"pushed_at":"2018-03-24T23:00:14.000Z","size":103,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-11T14:24:40.001Z","etag":null,"topics":["formatter","sprintf","vuejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/dimensi.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-03-23T20:55:40.000Z","updated_at":"2018-03-24T23:00:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"4647a61d-b6a8-49ef-80e0-bb1dad483a98","html_url":"https://github.com/dimensi/vue-sprintf-components","commit_stats":null,"previous_names":["eddimensi/vue-sprintf-components"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/dimensi/vue-sprintf-components","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimensi%2Fvue-sprintf-components","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimensi%2Fvue-sprintf-components/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimensi%2Fvue-sprintf-components/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimensi%2Fvue-sprintf-components/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimensi","download_url":"https://codeload.github.com/dimensi/vue-sprintf-components/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimensi%2Fvue-sprintf-components/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013696,"owners_count":26085390,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["formatter","sprintf","vuejs"],"created_at":"2024-10-03T19:10:16.291Z","updated_at":"2025-10-13T05:09:55.124Z","avatar_url":"https://github.com/dimensi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-sprintf-components\nSprintf with vue components\n\n## Demo\n[![Edit Vue Template](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/1492m3ypq3)\n\n## Install\nVia Yarn:\n```\nyarn add vue-sprintf-components\n```\n\nVia NPM:\n```\nnpm i vue-sprintf-components\n```\n\n## Quick start\n```html\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cVueSprintf text=\"component say: {0}\"\u003e\n      \u003cButtonUi\u003e\n        Hello!\n      \u003c/ButtonUi\u003e\n    \u003c/VueSprintf\u003e\n    \u003c!-- render: component say: \u003cbutton\u003ehello!\u003c/button\u003e --\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport VueSprintf from \"vue-sprintf-components\";\n\nexport default {\n  components: {\n    VueSprintf,\n    ButtonUi: {\n      template: '\u003cbutton\u003e\u003cslot\u003e\u003c/slot\u003e\u003c/button\u003e'\n    }\n  }\n};\n\u003c/script\u003e\n```\n\n## Usage\nThe component takes 2 props: `text` and `silence`\n* text\n  * type: `String`\n  * required: `true`  \nAny string with placeholders `{0}` and named placeholders `{name}`\n* silence\n  * type: `Boolean`  \nIf silence false, if there are not enough slots for placeholders, there will be an error\n* placeholders\n  * type: `Array|Object`  \nFallback placeholders if slots not enoght\n## Example\n### With args placeholders\n```html\n\u003cVueSprintf text=\"component say: {0}\"\u003e\n  \u003cButtonUi\u003e\n    Hello!\n  \u003c/ButtonUi\u003e\n\u003c/VueSprintf\u003e\n```\nTo render\n```html\ncomponent say: \u003cbutton\u003eHello!\u003c/button\u003e\n```\n\n\n### With named placeholders\n```html\n\u003cVueSprintf text=\"component 'a' say: {a} and component 'b' say: {b}\"\u003e\n  \u003cButtonUi slot=\"a\"\u003e\n    Hello!\n  \u003c/ButtonUi\u003e\n  \u003cButtonUi slot=\"b\"\u003e\n    Bye-Bye!\n  \u003c/ButtonUi\u003e\n\u003c/VueSprintf\u003e\n```\nTo render\n```html\ncomponent 'a' say: \u003cbutton\u003eHello!\u003c/button\u003e and component 'b' say: \u003cbutton\u003eBye-Bye!\u003c/button\u003e\n```\n\n### With named placeholders + fallback placeholders\n```html\n\u003cVueSprintf text=\"component 'a' say: {a} and component 'b' say: {b}\"\n  :placeholders=\"{ b: 'Bye-bye' }\"\u003e\n  \u003cButtonUi slot=\"a\"\u003e\n    Hello!\n  \u003c/ButtonUi\u003e\n\u003c/VueSprintf\u003e\n```\nTo render\n```html\ncomponent 'a' say: \u003cbutton\u003eHello!\u003c/button\u003e and component 'b' say: Bye-Bye!\n```\n\n### With list placeholders + fallback placeholders\n```html\n\u003cVueSprintf text=\"component '0' say: {0} and component '1' say: {1}\"\n  :placeholders=\"['Bye-bye']\"\u003e\n  \u003cButtonUi\u003e\n    Hello!\n  \u003c/ButtonUi\u003e\n\u003c/VueSprintf\u003e\n```\nTo render\n```html\ncomponent '0' say: \u003cbutton\u003eHello!\u003c/button\u003e and component '1' say: Bye-Bye!\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimensi%2Fvue-sprintf-components","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimensi%2Fvue-sprintf-components","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimensi%2Fvue-sprintf-components/lists"}