ArrayField

Form field component to handle array type values.

Props#

ArrayField#

PropTypeDefaultDescription
namerequiredTNameThe field name
childrentype ONLY_FOR_FORMAT = | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | PromiseLikeOfReactNode | ((props: ArrayField[]) => ReactNode)
defaultValueRecord<string, any>Default value for new values in the array
helpstringField help text
hideLabelbooleanHide the field label
isDisabledbooleanfalseIf true, the form control will be disabled. This has 2 side effects: - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled
isInvalidbooleanfalseIf true, the form control will be invalid. This has 2 side effects: - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true
isReadOnlybooleanfalseIf true, the form control will be readonly
isRequiredbooleanfalseIf true, the form control will be required. This has 2 side effects: - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true
keyNamestringidDefault key name for rows, change this if your data uses a different 'id' field
labelstringThe field label
maxnumber
minnumber
placeholderstringThe input placeholder
rulesOmit< RegisterOptions<TFieldValues, TName>, "disabled" | "setValueAs" | "valueAsDate" | "valueAsNumber" >React hook form rules
typestringBuild-in types: text, number, password, textarea, select, native-select, checkbox, radio, switch, pin Will default to a text field if there is no matching type.

ArrayFieldContainer#

PropTypeDefaultDescription
namerequiredstringThe field name
childrentype ONLY_FOR_FORMAT = | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | PromiseLikeOfReactNode
defaultValueRecord<string, any>Default value for new values in the array
helpstringField help text
hideLabelbooleanHide the field label
isDisabledbooleanfalseIf true, the form control will be disabled. This has 2 side effects: - The FormLabel will have `data-disabled` attribute - The form element (e.g, Input) will be disabled
isInvalidbooleanfalseIf true, the form control will be invalid. This has 2 side effects: - The FormLabel and FormErrorIcon will have `data-invalid` set to true - The form element (e.g, Input) will have `aria-invalid` set to true
isReadOnlybooleanfalseIf true, the form control will be readonly
isRequiredbooleanfalseIf true, the form control will be required. This has 2 side effects: - The FormLabel will show a required indicator - The form element (e.g, Input) will have `aria-required` set to true
keyNamestringidDefault key name for rows, change this if your data uses a different 'id' field
labelstringThe field label
maxnumber
minnumber
placeholderstringThe input placeholder
rulesOmit< RegisterOptions<FieldValues, string>, "disabled" | "setValueAs" | "valueAsDate" | "valueAsNumber" >React hook form rules
typestringBuild-in types: text, number, password, textarea, select, native-select, checkbox, radio, switch, pin Will default to a text field if there is no matching type.

ArrayFieldRows#

PropTypeDefaultDescription
childrenrequired( fields: ArrayField[], ) => ReactElement<any, string | JSXElementConstructor<any>> | null

ArrayFieldRowFields#

PropTypeDefaultDescription
autoColumnsResponsiveValue<GridAutoColumns<0 | (string & {})>>Shorthand prop for gridAutoColumns
autoFlowResponsiveValue<GridAutoFlow>Shorthand prop for gridAutoFlow
autoRowsResponsiveValue<GridAutoRows<0 | (string & {})>>Shorthand prop for gridAutoRows
childrentype ONLY_FOR_FORMAT = | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | PromiseLikeOfReactNodeThe fields
columnResponsiveValue<GridColumn>Shorthand prop for gridColumn
columnGapResponsiveValue<number | "px" | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "1" | "-1" | "2" | "-2" | "3" | "-3" | "4" | "-4" | "5" | "-5" | "6" | ... 53 more ... | "-3.5">Shorthand prop for gridColumnGap
columnsResponsiveValue<number>Amount of field columns
gapResponsiveValue<number | "px" | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "1" | "-1" | "2" | "-2" | "3" | "-3" | "4" | "-4" | "5" | "-5" | "6" | ... 53 more ... | "-3.5">Shorthand prop for gridGap
minChildWidthResponsiveValue<number | "px" | "max" | "min" | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "auto" | "max-content" | "min-content" | "sm" | ... 61 more ... | "-webkit-min-content">The width at which child elements will break into columns. Pass a number for pixel values or a string for any other valid CSS length.
rowResponsiveValue<GridRow>Shorthand prop for gridRow
rowGapResponsiveValue<number | "px" | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "1" | "-1" | "2" | "-2" | "3" | "-3" | "4" | "-4" | "5" | "-5" | "6" | ... 53 more ... | "-3.5">Shorthand prop for gridRowGap
spacingResponsiveValue<string | number>Spacing between fields
spacingXResponsiveValue<number | "px" | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "1" | "-1" | "2" | "-2" | "3" | "-3" | "4" | "-4" | "5" | "-5" | "6" | ... 53 more ... | "-3.5">The column gap between the grid items
spacingYResponsiveValue<number | "px" | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "1" | "-1" | "2" | "-2" | "3" | "-3" | "4" | "-4" | "5" | "-5" | "6" | ... 53 more ... | "-3.5">The row gap between the grid items
templateAreasResponsiveValue<GridTemplateAreas>Shorthand prop for gridTemplateAreas
templateColumnsResponsiveValue<GridTemplateColumns<0 | (string & {})>>Shorthand prop for gridTemplateColumns
templateRowsResponsiveValue<GridTemplateRows<0 | (string & {})>>Shorthand prop for gridTemplateRows

Was this helpful?