@forml/decorator-bootstrap

Bootstrap V4 forml decorator

Usage no npm install needed!

<script type="module">
  import formlDecoratorBootstrap from 'https://cdn.skypack.dev/@forml/decorator-bootstrap';
</script>

README

Table of Contents

  1. @forml/decorator-bootstrap
    1. Documentation
    2. Examples
    3. Installation
    4. Usage

forml

Build Status Libraries.io dependency status for latest release Coverage Status npm npm

@forml/decorator-bootstrap - A forml decorator for Bootstrap V4

forml is a lightweight and powerful form generator. Given a JSON schema, it creates React powered forms. This decorator produces forms designed with Bootstrap V4.

Documentation

View the documentation at forml.dev!

Examples

You can view the running demo.

Installation

# Substitute @forml/decorator-mui with your preferred decorator
npm i @forml/core @forml/decorator-bootstrap

Usage

Basic usage is as follows:

import { SchemaForm } from "@forml/core";
import * as decorator from "@forml/decorator-bootstrap";
import { useState } from "react";

export function MyForm(props) {
  const [model, setModel] = useState("");
  const schema = { type: "string", title: "Sample Form" };
  const form = ["*"];

  return (
    <SchemaForm
      model={model}
      schema={schema}
      decorator={decorator}
      form={form}
      onChange={onChange}
    />
  );

  function onChange(event, model) {
    setModel(model);
  }
}

Contributing

forml prides itself on being easily extensible. More UI packages are being added and contributions are welcome.