New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-aztec

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-aztec

Material UI based dynamic form component for React using JSON-Schema

latest
Source
npmnpm
Version
0.1.36
Version published
Maintainers
1
Created
Source

react-aztec

GitHub issues npm version

Build dynamic forms using Material UI

Check demo & detail docs Documentation

Build dynamic forms using interactive editor Playground

Installation

npm install material-ui --save npm install react-aztec --save

Basic Usage

Refer Material-UI documentation for components props

import { TextField } as MUI from 'material-ui';
import { Aztec } from 'react-aztec';

const formData = [
  {
    id: "name",
    type: 'textfield',
    props: {
      id: 'name',
      floatingLabelText: 'Hello, Whats your name?',
      hintText: 'Name is required'
    }
  }  
];

class SimpleForm extends React.Component {
  render() {
    return (
      <div>
        <Aztec
          guid="unique-id"
          data={formData}
          library={MUI}
        />
      </div>
    )
  }
}

Usage with form validation

import * as MUI from 'material-ui';
import { Aztec } from 'react-aztec';

const formData = [
  {
    id: "name",
    type: 'textfield',
    props: {
      id: 'name',
      floatingLabelText: 'Hello, Whats your name?',
      hintText: 'Name is required'
    },
    rules: {
      validation: [
        {
          rule: 'mandatory', //email, lowercase, mobile
          message: 'Name is required!!' // on error message to be displayed
        }
      ]
    }
  }  
];

class SimpleForm extends React.Component {
  render() {
    return (
      <div>
        <Aztec
          guid="unique-id"
          data={formData}
          library={MUI}
        />
      </div>
    )
  }
}

Usage with form layout

Aztec uses bootstrap 24 column grid layout

import * as MUI from 'material-ui';
import { Aztec } from 'react-aztec';

const formData = [
  {
    id: "name",
    type: 'textfield',
    props: {
      id: 'name',
      floatingLabelText: 'Hello, Whats your name?',
      hintText: 'Name is required'
    },
    layout: {
      row: 1,
      xs: {
        col:24
      },
      sm: {
        col:24
      },
      md: {
        col:12
      },
      lg: {
        col:8
      }
    }
  }  
];

class SimpleForm extends React.Component {
  render() {
    return (
      <div>
        <Aztec
          guid="unique-id"
          data={formData}
          library={MUI}
        />
      </div>
    )
  }
}

Contribute

If you have a feature request, please add it as an issue or make a pull request.

License

MIT

Keywords

react

FAQs

Package last updated on 17 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts