npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-metaform

v0.9.4

Published

A library for dynamically creating React.js forms out of metadata

Downloads

41

Readme

React-metaform

Join the chat at https://gitter.im/gearz-lab/react-metaform Travis

React-metaform is a React library for dynamically generating forms based on metadata. This is particularly useful for creating data-centric business applications in which the schema is flexible and needs to be stored in the database. This is also useful in other scenarios in which the forms are dynamic and cannot be hard-coded.

This project is similar to Meteor Autoform.

Alpha version disclaimer

React-metaform is under active development. APIs will change and things may still not work as expected. If you find any issue, please report it. I'll do my best to fix it. These are the known issues scheduled for the 1.0.0 version.

Demo

You can check the online demo here.

Docs

Docs are available here.

Installing

For now, react-metaform is only supports npm. Bower supported is on the way.

Install:

npm install react-metaform

Using

####MetaForm (source)####

The main React component.

import MetaForm from 'react-metaform/lib/MetaForm';

The MetaForm props are listed here.

Additionally, you need a ComponentFactory. The ComponentFactory is responsible for determining which React component to use for a given field metadata. React-metaform comes with 2 ComponentFactories:

####ComponentFactory (source)####

This a clean factory. In order to use it, import it, register all your components and then pass it to the componentFactory prop of the MetaForm.

import ComponentFactory from 'react-metaform/lib/ComponentFactory';

####DefaultComponentFactory (source)####

This is a pre-populated factory, the same used in the demo. In order to use it, import it and just pass it to the componentFactory prop of the MetaForm.

import DefaultComponentFactory from 'react-metaform/lib/DefaultComponentFactory';

Alternatively:

import rmf from 'react-metaform';
// now these are available:
//  rmf.MetaForm
//  rmf.ComponentFactory
//  rmf.DefaultComponentFactory

Building and running the demo locally

This should work in every environment, except that environment variables are being set in the npm scripts which make them not platform-independent. This should be fixed for the 1.0.0 release. If you're on Linux or OSX, please remove the environment SETs from the package.json scripts before you proceed.

git clone https://github.com/gearz-lab/react-metaform.git
cd react-metaform
npm install

In order to run the demo, while this issue is not fixed, you need to run 2 npm commands:

npm run wpds
npm run start-demo-dev

Now the demo should be available here: http://localhost:4000/react-metaform/demo.html.

In order to run the karma tests:

npm run test
// OR, to run in Chrome instead of PhantomJS
npm run test-chrome
 

Change log

What has changed is stated here.

Contributing

Pull-requests are really really welcome. If you don't know what to contribute with, please check the 1.0.0 issues.

I'll be more than glad to invite frequent contributors to join the organization. If you need help understanding the project, please post an issue and I'll do my best to reply and make sure you understand everything you need.

In order to make a pull request:

  1. Fork it.
  2. Create your feature-branch git checkout -b your-new-feature-branch
  3. Commit your change git commit -am 'Add new feature'
  4. Push to the branch git push origin your-new-feature-branch
  5. Create new Pull Request with master branch

License

React-metaform is MIT licensed.