Components
Tabs

Tabs

The Tabs tabs is a layout component, use it to organize fields in multiple tabs. Fields are defined in fields key as hash object, each key of the fields objects is an array of fields and must match the values of the tabs array of object.

Example

{
  "component": "tabs",
  "label": "My Tabs",
  "name": "my_tabs",
  "tabs": [
    {
      "value": "one",
      "label": "One"
    },
    {
      "value": "two",
      "label": "Two"
    },
    {
      "value": "three",
      "label": "Three"
    }
  ],
  "fields": {
    "one": [
      {
        "component": "input-text",
        "label": "Field 2",
        "name": "field_2"
      }
    ],
    "two": [
      {
        "component": "input-text",
        "label": "Field 3",
        "name": "field_3"
      }
    ],
    "three": [
      {
        "component": "input-text",
        "label": "Field 4",
        "name": "field_4"
      }
    ]
  }
}

LetsForm DSL

The above example can also be defined with LetsForm DSL

<LfTabs
  label="Field 1"
  name="field_1"
>
  <LfTab
    value="one"
    label="One"
  >
    <LfField
      component="input-text"
      label="Field 2"
      name="field_2"
    />
  </LfTab>
  <LfTab
    value="two"
    label="Two"
  >
    <LfField
      component="input-text"
      label="Field 3"
      name="field_3"
    />
  </LfTab>
  <LfTab
    value="three"
    label="Three"
  >
    <LfField
      component="input-text"
      label="Field 4"
      name="field_4"
    />
  </LfTab>
</LfTabs>
};
 
export { MyForm };
Loading...

Reference

PropertyTypeDescription
componentstring
= "tabs"
namestringThe name of the field and the key of the JSON
tabs[column]An array of object (with value and label keys) which defines the tabs
hiddenbooleanHides the field from the form
Pick up a framework to show specific properties

Properties for tab object

PropertyTypeDescription
valuestringInternal name for tab, to be used with Form Scripts
labelstringName of the tab
Pick up a framework to show specific properties
React Suite