Skip to content

A react native liabrary to create single page form using single json

Notifications You must be signed in to change notification settings

poonamdhomane/react_native_dynamic_form_typescript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Native Dynamic Form From JSON

Description

A dependency to create basic form using with just single JSON. Which even can return a single json for submission.

Installation

npm install react_native_form_simplified_typescript
                OR
yarn add react_native_form_simplified_typescript

Usage

Live code example

import InputForm, {
  IFormProvider,
} from "react_native_form_simplified_typescript";
function Example() {
  let options = {
    json: formJson,
    schema: schema,
    outlined: true,
    submit: true,
    spaceInFields: true,
    isVerticalCenter: true,
  };
  const onSubmit = async (data) => {
    Alert.alert("data is", JSON.stringify(data));
  };

  return (
    <View style={{ flex: 1 }}>
      <IFormProvider options={options} onSubmitTapped={onSubmit}>
        <InputForm></InputForm>
      </IFormProvider>
    </View>
  );
}

Example Form JSON

const formJson = [
  {
    type: 'text',
    name: 'username',
    label: 'Username',
    value: null,
  },
  {
    type: 'password',
    name: 'password',
    label: 'Password',
    value: null,
  },
];

About

A react native liabrary to create single page form using single json

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published