{"id":17651353,"url":"https://github.com/nash403/graphicon","last_synced_at":"2025-05-07T07:47:46.826Z","repository":{"id":57253243,"uuid":"116580407","full_name":"nash403/graphicon","owner":"nash403","description":"A Vue.js plugin/component to help you manage your icons seamlessly","archived":false,"fork":false,"pushed_at":"2019-05-27T22:07:28.000Z","size":221,"stargazers_count":12,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-04T03:02:45.930Z","etag":null,"topics":["icons","svg","svg-icons","svg-inline-loader","vue","vue-icon","webpack"],"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/nash403.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":"2018-01-07T16:21:12.000Z","updated_at":"2020-07-28T13:16:15.000Z","dependencies_parsed_at":"2022-09-12T05:00:17.899Z","dependency_job_id":null,"html_url":"https://github.com/nash403/graphicon","commit_stats":null,"previous_names":["nash403/g-icon"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nash403%2Fgraphicon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nash403%2Fgraphicon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nash403%2Fgraphicon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nash403%2Fgraphicon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nash403","download_url":"https://codeload.github.com/nash403/graphicon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252839174,"owners_count":21812083,"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":["icons","svg","svg-icons","svg-inline-loader","vue","vue-icon","webpack"],"created_at":"2024-10-23T11:41:56.727Z","updated_at":"2025-05-07T07:47:46.799Z","avatar_url":"https://github.com/nash403.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphIcon\n\n\u003e A Vue.js plugin/component to help you manage your icons seamlessly\n\n## Installation\n\n`npm install graphicon` or `yarn add graphicon`\n\n## Usage\n\n* Install the plugin:\n\n  ```js\n  // Declare your icons\n  import GIcon from 'graphicon' // or use `window.GraphIcon` in browsers\n\n  // Here I use the svg-inline-loader for webpack to load contents of svg files\n  // but you could any method that suits you\n  // This will call `Vue.component('GIcon', GIcon)` internally (or with provided component name)\n  Vue.use(GIcon, {\n    'arrow-left': require('!svg-inline-loader!@/assets/icons/arrow-left.svg'),\n    'arrow-right': [require('!svg-inline-loader!@/assets/icons/arrow-right.svg'), {...defaultSvgAttributes...}],\n    // You can pass a `keepAttrs` key to keep attributes from the original svg tag.\n    // The value can be either `true` to keep all attributes, or an array of keys to be kept.\n    ...\n  }/*, 'ComponentName' // (defaults: 'GIcon')  */)\n\n  // Or just call at some point\n  GIcon.setIcons({ ...your icons... })\n  ```\n\n* Then use `GIcon` in your components:\n\n  ```html\n  \u003c!-- the GIcon component will render as `\u003ci class=\"GIcon\" v-html=\"[icon content]\"\u003e\u003c/i\u003e` --\u003e\n\n  \u003c!-- call with icon name --\u003e\n  \u003cGIcon name=\"icon-name\" :options=\"{...}\"/\u003e\n\n  \u003c!-- or with raw svg string --\u003e\n  \u003cGIcon rawSvg=\"svg contents here\" :options=\"{...}\"/\u003e\n\n  \u003c!-- or if you use font-awesome for example you can just pass classes down to GIcon --\u003e\n  \u003cGIcon :class=\"fa-icon-name fa-...\" /\u003e\n\n  \u003c!-- Since v1.1.0 you can control sizes with more ease.\n  box-size \u0026 font-size will set the width, the height and the font-size of the \u003ci\u003e.\n  See also options section below. --\u003e\n  \u003cGIcon name=\"icon-name\" box-size=\"2em\" font-size=\"2em\" /\u003e\n  ```\n\n  If you didn't install the plugin with Vue.use you'll have to declare the GIcon component first:\n\n  ```js\n  import GIcon from 'graphicon'\n\n  {\n    ...\n    components: {\n      GIcon\n    },\n    ...\n  }\n  ```\n\n## Options\n\nThe `options` props of `GIcon` is an object containing attributes that will be merged to default attributes and passed to the root svg element of icons. The defaults attributes are the following:\n\n```json\n{\n  \"xmlns\": \"http://www.w3.org/2000/svg\",\n  \"width\": \"1em\",\n  \"height\": \"1em\",\n  \"viewBox\": \"0 0 24 24\",\n  \"fill\": \"none\",\n  \"stroke\": \"currentColor\",\n  \"stroke-width\": 2,\n  \"stroke-linecap\": \"round\",\n  \"stroke-linejoin\": \"round\"\n}\n```\n\n## Example\n\n1. `git clone` the repo\n2. run `cd graphicon/test \u0026\u0026 vue serve src/main.js` and it will serve an example app at localhost:8080 (require `@vue/cli` to be installed)\n3. Enjoy :tada:\n\n## Licence\n\nMIT License\n\nCopyright (c) 2018 Honoré Nintunze\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n\u003e Icons are from [Feather icons](https://feathericons.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnash403%2Fgraphicon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnash403%2Fgraphicon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnash403%2Fgraphicon/lists"}