Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svg-element-attributes

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svg-element-attributes

Map of SVG elements to allowed attributes

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

svg-element-attributes Build Status

Map of SVG elements to allowed attributes. Also contains global attributes under '*'.

Includes attributes from SVG 1.1, SVG Tiny 1.2, and SVG 2.

Note: Does not include ARIA attributes (role, aria-*), xml:* or xlink:* attributes, event attributes (on*), or ev:event.

Installation

npm:

npm install svg-element-attributes

Usage

var svgElementAttributes = require('svg-element-attributes');

var globals = svgElementAttributes['*'];

Yields:

[ 'class',
  'content',
  'datatype',
  'id',
  'property',
  'rel',
  'resource',
  'rev',
  'typeof',
  'lang',
  'tabindex' ]

Attributes on the circle element:

var circle = svgElementAttributes.circle;

Yields:

[ 'cx',
  'cy',
  'focusHighlight',
  'focusable',
  'nav-down',
  'nav-down-left',
  'nav-down-right',
  'nav-left',
  'nav-next',
  'nav-prev',
  'nav-right',
  'nav-up',
  'nav-up-left',
  'nav-up-right',
  'r',
  'requiredExtensions',
  'requiredFeatures',
  'requiredFonts',
  'requiredFormats',
  'systemLanguage',
  'transform',
  'alignment-baseline',
  'externalResourcesRequired',
  'style',
  'pathLength' ]

API

svgElementAttributes

Object.<Array.<string>> — Map of lower-case tag-names to an array of lower-case attribute names.

The object contains one special key: '*', which contains global attributes which apply to all SVG elements.

License

MIT © Titus Wormer

Keywords

FAQs

Package last updated on 21 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc