Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
react-html-attributes
Advanced tools
Readme
A store of React HTML attributes keyed by their respective tags. Global
attributes and React specific attributes are under '*'
. A HTML tag will map
to all the html attributes supported by React. HTML tags that don't have any
React-supported non-global attributes won't have keys in the store.
The store also has all HTML and SVG tags supported by React under the key,
'elements'
which will map to an object with keys, 'svg'
and 'html'
.
The React docs have been updated to remove a list of tags supported, so it
is assumed that React now supports all available tags. If that is not the
case, please raise an issue here.
One more note: all SVG element attributes supported by React are under the
'svg'
key to avoid too many duplicated values and unnecessary file size.
Reference: React docs
npm:
npm install react-html-attributes
var htmlElementAttributes = require('react-html-attributes');
htmlElementAttributes['*'];
Returns:
[
"acceptCharset",
"accessKey",
"allowFullScreen",
"allowTransparency",
"autoComplete",
"autoFocus",
"autoPlay",
"capture",
"cellPadding",
"cellSpacing",
"charSet",
"classID",
"className",
"colSpan",
"contentEditable",
"contextMenu",
"crossOrigin",
"dangerouslySetInnerHTML",
"dateTime",
"dir",
"draggable",
"encType",
"formAction",
"formEncType",
"formMethod",
"formNoValidate",
"formTarget",
"frameBorder",
"hidden",
"hrefLang",
"htmlFor",
"httpEquiv",
"id",
"inputMode",
"is",
"itemID",
"itemProp",
"itemRef",
"itemScope",
"itemType",
"keyParams",
"keyType",
"lang",
"marginHeight",
"marginWidth",
"maxLength",
"mediaGroup",
"minLength",
"noValidate",
"radioGroup",
"readOnly",
"role",
"rowSpan",
"scoped",
"seamless",
"spellCheck",
"srcDoc",
"srcLang",
"srcSet",
"style",
"suppressContentEditableWarning",
"tabIndex",
"title",
"useMap",
"wmode"
]
htmlElementAttributes['elements']['svg'];
returns:
[
"circle",
"clipPath",
"defs",
"ellipse",
"g",
"image",
"line",
"linearGradient",
"mask",
"path",
"pattern",
"polygon",
"polyline",
"radialGradient",
"rect",
"stop",
"svg",
"text",
"tspan"
]
Commit by
npm run commit
I am open to suggestions in improving this library. If you know any page that has a better list related to SVG properties, HTML properties or React-supported HTML properties to be crawled. Please let me know!
MIT © Jacky Ho
FAQs
A react supported html attributes store keyed by their tags
The npm package react-html-attributes receives a total of 44,566 weekly downloads. As such, react-html-attributes popularity was classified as popular.
We found that react-html-attributes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.