@visma/form-ula

0.6.5 • Public • Published

Form ULA 🏎️

Form ULA form generator.

Example

import FormULA from "@visma/form-ula";
import FIELD from "@visma/form-ula/es/constants/fieldIDs";
import * as ELEMENT from "@visma/form-ula/es/constants/elementTypes";
import * as TYPE from "@visma/form-ula/es/constants/fieldTypes";
import { Button } from "react-bootstrap";

<FormULA
  design={{
    [FIELD.TITLE]: { en: "Feedback", fi: "Palaute" },
    [FIELD.ELEMENTS]: [
      {
        type: ELEMENT.FIELD,
        id: 0
      },
      {
        type: ELEMENT.FIELD,
        id: 1
      }
    ]
  }}
  fields={[
    {
      [FIELD.TYPE]: TYPE.TEXT,
      [FIELD.NAME]: {
        en: "Title",
        fi: "Otsikko"
      },
      _id: 0
    },
    {
      [FIELD.TYPE]: TYPE.TEXTAREA,
      [FIELD.NAME]: {
        en: "Message",
        fi: "Viesti"
      },
      _id: 1
    }
  ]}
  onSubmit={console.log}
>
  <Button type="submit">Submit</Button>
</FormULA>;

/@visma/form-ula/

    Package Sidebar

    Install

    npm i @visma/form-ula

    Weekly Downloads

    15

    Version

    0.6.5

    License

    ISC

    Unpacked Size

    655 kB

    Total Files

    281

    Last publish

    Collaborators

    • visma_bot
    • arnosaine
    • juusoko