# react-html-attributes

> A react supported html attributes store keyed by their tags

Latest version **1.4.6** (published 2019-04-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-html-attributes
pnpm add react-html-attributes
yarn add react-html-attributes
bun add react-html-attributes
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.6 |
| Published | 2019-04-11 |
| First published | 2017-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 105.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Author | Jacky Ho |
| Maintainers | jackyho112 |
| Keywords | html, react, attributes |

## Links

- npm: https://www.npmjs.com/package/react-html-attributes
- Repository: https://github.com/jackyho112/react-html-attributes
- Homepage: https://github.com/jackyho112/react-html-attributes#readme
- Issues: https://github.com/jackyho112/react-html-attributes/issues
- npm.io page: https://npm.io/package/react-html-attributes

## Dependencies (1)

- [html-element-attributes](https://npm.io/package/html-element-attributes.md) ^1.0.0

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.4.6 (latest) — 2019-04-11
- 1.4.5 — 2019-04-11
- 1.4.4 — 2019-04-11
- 1.4.3 — 2018-07-23
- 1.4.2 — 2018-04-18
- 1.4.1 — 2017-07-21
- 1.4.0 — 2017-07-13
- 1.3.0 — 2017-05-02
- 1.2.7 — 2017-04-29
- 1.2.6 — 2017-04-22
- 1.2.5 — 2017-04-22
- 1.2.4 — 2017-04-20
- 1.2.3 — 2017-04-20
- 1.2.2 — 2017-04-20
- 1.2.1 — 2017-04-12
- … 7 more at https://npm.io/package/react-html-attributes/versions

## README

[![Build Status][build-badge]][build-page]
[![version][version-badge]][package]

# react-html-attributes

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](https://github.com/facebook/react/issues/new).

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](https://facebook.github.io/react/docs/dom-elements.html)

## Installation

npm:

```bash
npm install react-html-attributes
```

## Usage

```javascript
var htmlElementAttributes = require('react-html-attributes');
```

```javascript
htmlElementAttributes['*'];
```

Returns:

```javascript
[
  "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"
]
```

```javascript
htmlElementAttributes['elements']['svg'];
```

returns:

```javascript
[
  "circle",
  "clipPath",
  "defs",
  "ellipse",
  "g",
  "image",
  "line",
  "linearGradient",
  "mask",
  "path",
  "pattern",
  "polygon",
  "polyline",
  "radialGradient",
  "rect",
  "stop",
  "svg",
  "text",
  "tspan"
]
```

## Contributing

Commit by

```bash
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!

## License

[MIT][license] © Jacky Ho

<!-- Definition -->
[license]: LICENSE
[build-page]: https://travis-ci.org/jackyho112/react-html-attributes.svg
[build-badge]: https://img.shields.io/travis/jackyho112/react-html-attributes.svg
[version-badge]: https://img.shields.io/npm/v/react-html-attributes.svg?style=flat-square
[package]: https://www.npmjs.com/package/react-html-attributes

---
_Source: https://npm.io/package/react-html-attributes · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
