Skip to main content

group

  • Data type: DataType
  • JSON Schema data type: object

The group component allows you to create a group of components. The group can be grouped in the form using group widgets and the data in the grouped components will be added to an object.

Example

import React from "react";
import { createForm, group, textField, StatefulFormView } from "@fab4m/fab4m";
import "@fab4m/fab4m/css/basic/basic.css";

const form = createForm({
groupOfFields: group(
{
label: "Countries",
multiple: true,
minItems: 1,
},
{
name: textField({
label: "Country name",
}),
capital: textField({
label: "Capital",
}),
}
),
});

export default function TextFieldExample() {
return <StatefulFormView form={form} hideSubmit={true} />;
}

Available Widgets