{"id":15413476,"url":"https://github.com/wooorm/svg-element-attributes","last_synced_at":"2025-04-14T06:47:24.323Z","repository":{"id":60775173,"uuid":"87651182","full_name":"wooorm/svg-element-attributes","owner":"wooorm","description":"Map of SVG elements to allowed attributes","archived":false,"fork":false,"pushed_at":"2024-01-13T10:47:07.000Z","size":115,"stargazers_count":26,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T20:38:52.301Z","etag":null,"topics":["attributes","element","svg","tag"],"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/wooorm.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":"funding.yml","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},"funding":{"github":"wooorm"}},"created_at":"2017-04-08T17:23:01.000Z","updated_at":"2024-11-21T16:35:31.000Z","dependencies_parsed_at":"2024-01-13T12:14:23.762Z","dependency_job_id":"4d7e4547-a418-469b-95ab-b4c06583f534","html_url":"https://github.com/wooorm/svg-element-attributes","commit_stats":{"total_commits":63,"total_committers":1,"mean_commits":63.0,"dds":0.0,"last_synced_commit":"cae05ab2b9afaa362bd9378159cc49a5498d090b"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wooorm%2Fsvg-element-attributes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wooorm%2Fsvg-element-attributes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wooorm%2Fsvg-element-attributes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wooorm%2Fsvg-element-attributes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wooorm","download_url":"https://codeload.github.com/wooorm/svg-element-attributes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654095,"owners_count":21140236,"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":["attributes","element","svg","tag"],"created_at":"2024-10-01T16:57:15.880Z","updated_at":"2025-04-14T06:47:24.285Z","avatar_url":"https://github.com/wooorm.png","language":"JavaScript","funding_links":["https://github.com/sponsors/wooorm"],"categories":[],"sub_categories":[],"readme":"# svg-element-attributes\n\n[![Build][badge-build-image]][badge-build-url]\n[![Coverage][badge-coverage-image]][badge-coverage-url]\n[![Downloads][badge-downloads-image]][badge-downloads-url]\n[![Size][badge-size-image]][badge-size-url]\n\nMap of SVG elements to allowed attributes.\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`svgElementAttributes`](#svgelementattributes)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis is a map of tag names to lists of allowed attributes.\nGlobal attributes are stored at the special tag name `*`.\nAll attributes from [SVG 1.1][w3-svg-1.1], [SVG Tiny 1.2][w3-svg-1.2], and\n[SVG 2][w3-svg-2.0] are included.\n\n\u003e 👉 **Note**: Includes deprecated attributes.\n\n\u003e 👉 **Note**: ARIA (`role`, `aria-*`), event (`ev:event`, `on*`), or `xml:*`\n\u003e and `xlink:*` attributes are not included.\n\n## When should I use this?\n\nYou can use this to figure out if certain attributes are allowed on certain\nSVG elements.\n\n## Install\n\nThis package is [ESM only][github-gist-esm].\nIn Node.js (version 16+),\ninstall with [npm][npm-install]:\n\n```sh\nnpm install svg-element-attributes\n```\n\nIn Deno with [`esm.sh`][esm-sh]:\n\n```js\nimport {svgElementAttributes} from 'https://esm.sh/svg-element-attributes@2'\n```\n\nIn browsers with [`esm.sh`][esm-sh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import {svgElementAttributes} from 'https://esm.sh/svg-element-attributes@2?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\n```js\nimport {svgElementAttributes} from 'svg-element-attributes'\n\nconsole.log(svgElementAttributes['*'])\nconsole.log(svgElementAttributes.circle)\n```\n\nYields:\n\n```js\n[\n  'about',\n  'class',\n  'content',\n  'datatype',\n  'id',\n  'lang',\n  'property',\n  'rel',\n  'resource',\n  'rev',\n  'tabindex',\n  'typeof' ]\n[\n  'alignment-baseline',\n  'baseline-shift',\n  'clip',\n  'clip-path',\n  'clip-rule',\n  // …\n  'transform',\n  'unicode-bidi',\n  'visibility',\n  'word-spacing',\n  'writing-mode' ]\n```\n\n## API\n\nThis package exports the identifier\n[`svgElementAttributes`][api-svg-element-attributes].\nThere is no default export.\n\nIt exports no [TypeScript][] types.\n\n### `svgElementAttributes`\n\nMap of SVG elements to allowed attributes (`Record\u003cstring, Array\u003cstring\u003e\u003e`).\n\n## Compatibility\n\nThis projects is compatible with maintained versions of Node.js.\n\nWhen we cut a new major release,\nwe drop support for unmaintained versions of Node.\nThis means we try to keep the current release line,\n`svg-element-attributes@2`,\ncompatible with Node.js 12.\n\n## Security\n\nThis package is safe.\n\n## Related\n\n*   [`wooorm/web-namespaces`](https://github.com/wooorm/web-namespaces)\n    — list of web namespaces\n*   [`wooorm/html-tag-names`](https://github.com/wooorm/html-tag-names)\n    — list of HTML tag names\n*   [`wooorm/mathml-tag-names`](https://github.com/wooorm/mathml-tag-names)\n    — list of MathML tag names\n*   [`wooorm/svg-tag-names`](https://github.com/wooorm/svg-tag-names)\n    — list of SVG tag names\n*   [`wooorm/html-void-elements`](https://github.com/wooorm/html-void-elements)\n    — list of void HTML tag names\n*   [`wooorm/html-element-attributes`](https://github.com/wooorm/html-element-attributes)\n    — map of HTML elements to attributes\n*   [`wooorm/aria-attributes`](https://github.com/wooorm/aria-attributes)\n    — list of ARIA attributes\n\n## Contribute\n\nYes please!\nSee [How to Contribute to Open Source][open-source-guide-contribute].\n\n## License\n\n[MIT][file-license] © [Titus Wormer][wooorm]\n\n\u003c!-- Definition --\u003e\n\n[api-svg-element-attributes]: #svgelementattributes\n\n[badge-build-image]: https://github.com/wooorm/svg-element-attributes/workflows/main/badge.svg\n\n[badge-build-url]: https://github.com/wooorm/svg-element-attributes/actions\n\n[badge-coverage-image]: https://img.shields.io/codecov/c/github/wooorm/svg-element-attributes.svg\n\n[badge-coverage-url]: https://codecov.io/github/wooorm/svg-element-attributes\n\n[badge-downloads-image]: https://img.shields.io/npm/dm/svg-element-attributes.svg\n\n[badge-downloads-url]: https://www.npmjs.com/package/svg-element-attributes\n\n[badge-size-image]: https://img.shields.io/bundlejs/size/svg-element-attributes\n\n[badge-size-url]: https://bundlejs.com/?q=svg-element-attributes\n\n[esm-sh]: https://esm.sh\n\n[file-license]: license\n\n[github-gist-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[npm-install]: https://docs.npmjs.com/cli/install\n\n[open-source-guide-contribute]: https://opensource.guide/how-to-contribute/\n\n[typescript]: https://www.typescriptlang.org\n\n[w3-svg-1.1]: https://www.w3.org/TR/SVG/attindex.html\n\n[w3-svg-1.2]: https://www.w3.org/TR/SVGTiny12/attributeTable.html\n\n[w3-svg-2.0]: https://www.w3.org/TR/SVG2/attindex.html\n\n[wooorm]: https://wooorm.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwooorm%2Fsvg-element-attributes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwooorm%2Fsvg-element-attributes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwooorm%2Fsvg-element-attributes/lists"}