Coder Social home page Coder Social logo

react-native-formio's Introduction

This repository is now considered legacy and no longer supported. Please take a look at our recent repositories and help documentation at the following links.

React Native Formio

A React component for rendering out forms based on the Form.io platform.

Install

npm

React Formio can be used on the server, or bundled for the client using an npm-compatible packaging system such as Browserify or webpack.

npm install react-formio --save

Browser bundle

The browser bundle exposes a global Formio variable and expects to find a global React variable to work with.

You can find it in the /dist directory.

Usage

Give Formio a src property and render:

** For es5 require() modules. **

var React = require('react');
var ReactDOM = require('react-dom');
var Formio = require('react-formio').Formio;

** For es6 import/export modules. **

import React from 'react';
import ReactDOM from 'react-dom';
import {Formio} from 'react-formio';
ReactDOM.render(
  <Formio src="https://example.form.io/example" />
  , document.getElementById('example')
);

Props

src : string

The form API source from form.io or your custom formio server.

See the Creating a form for where to set the API Path for your form.

You can also pass in the submission url as the src and the form will render with the data populated from the submission.

form : object

An object representing the form. Use this instead of src for custom forms.

Note: src will override this property if used.

submission: Object

An object representing the default data for the form.

Note: src will override this if a submission url is entered.

onChange : (submission: object, key: string, value: mixed)

A function callback that will be called when any field is changed. The full submission is passed as well as the field that is changing's key and value.

onFormSubmit : (submission: object)

A function callback that will be called when a submission is successful.

onFormError : (response: object)

A function callback that will be called when a submisison is unsuccessful.

onFormLoad : (form: object)

A function callback that will be called with a form is finished loading.

onSubmissionLoad : (submission: object)

A function callback that will be called after a submission is loaded.

onElementRender : (element: object)

A function callback that will be called each time a component is rendered.

options : object

A settings object to pass various options into the form. skipInit will stop the form from initialling setting values on the submission object which will result in data only changing when a user interacts with the form.

options={
  skipInit: true
}

License

Released under the MIT License.

react-native-formio's People

Contributors

abhishekthorat-tudip avatar batusai513 avatar johnazre avatar joxertmd avatar nickkhall avatar randallknutson avatar realbisoye avatar sandy987 avatar travist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-formio's Issues

Is the library ready?

Hi

We are wondering if the library is ready for react-native, as we need to build mobile versions of our forms.

Thanks

Consider converting from mixins to ES6 classes?

We should explore changing the framework from using mixins to es6 classes and not use React.createComponent. If this would be a massive effort we should not do it. Otherwise we should convert over before we get too down development.

Convert textfield component render method

Library ready for use

Hi

Is the library ready for use? We are extensively using formio and have not seen any updates on this library. Could someone from development team please confirm on that?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.