@visma/form-ula
v0.6.5
Published
Form ULA form generator.
Downloads
236
Readme
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>;