Field Legos are used to define a field to be used within a Form Lego.
There are many premade Field Legos available for use in /src/data/fields.js (opens in a new tab)
See Field Legos in action in the Mint a Million Tutorial
Field Lego Parameters
Parameter | Data Type | Description |
---|---|---|
type | STRING | This value tells the factory component which UI element to render. This includes generic and standardized inputs. |
label | STRING | This value tells the factory component what to render as the input's label. |
name | STRING | This is the 'key' or 'id' for the data enterred into the input. This value:name values on the form.values object under the key entered as name . |
htmlFor | STRING | Links the input's name with its label for accessibility purposes. If falsy, the htmlFor will default to the input's name. |
placeholder | STRING | Placeholder text for the input. |
info | STRING | field.info value, the component's wrapper will display an info icon, with a hoverable tooltip that displays the string value enterred in the info field. |
expectType | STRING | number . The validation would then look at the string the input receives and check if all the characters in the string are all numbers. |
selectName | STRING | The secondary name of the input select component that is stored in the values object. |
helperText | STRING | This is the text underneath the field if you want to hard code instead of dealing with it inside of the component. |