Indicate a field is *required in a collection

Currently, it’s not possible to modify the css of the input’s label as it located in the buffetjs library.
However, until we make an update to the inputs to add a visual indicator for required field (which is not planned ATM) I am seeing to options for you to add an * for the required fields.

  • Manually edit the required fields label using the setting view. This option is the easiest one and will not require you to make any code modification to your app so upgrades are easier.
  • Use the extension option in order to edit this file with the following:
// ... previous code
const label = isRequired ? `${metadatas.label}*` : metadatas.label;

<InputsIndex
   {...metadatas}
   label={label}
   // rest of the code
2 Likes