react-domify

0.2.6 • Public • Published

React DOMify

Like JSON.strinfigy but uses React.js to generate DOM elements.

Demo & Examples

Live demo: JedWatson.github.io/react-domify

To build the examples locally, run:

npm install
gulp dev

Then open localhost:8000 in a browser.

Installation

The easiest way to use react-domify is to install it from NPM and include it in your own React build process (using Browserify, Webpack, etc).

You can also use the standalone build by including dist/react-domify.js in your page. If you use this, make sure you have already included React, and it is available as a global variable.

npm install react-domify --save

Usage

Provide the variable to render as the value property.

var DOMify = require('react-domify');

var data = {
  str: 'It formats strings, numbers, booleans and dates',
  bool: true,
  date: new Date(),
  num: 42,
  arr: [
    'And nested arrays / objects',
    {
      key: 'value'
    }
  ]
};

<DOMify value={data} />

License

MIT. Copyright (c) 2016 Jed Watson.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.2.61,555latest

Version History

VersionDownloads (Last 7 Days)Published
0.2.61,555
0.2.51
0.2.41
0.2.21
0.2.11
0.2.02
0.1.21
0.1.11
0.1.01

Package Sidebar

Install

npm i react-domify

Weekly Downloads

1,564

Version

0.2.6

License

MIT

Last publish

Collaborators

  • jedwatson