I don’t see a setting, (or even an obvious CSS class I can tie in to) to allow me to indicate to users that a give field is required – either outlined in red, or with that universal eye-of-sauron asterisk (*).
Seems right now the only way to know is by not filling it out and getting a warning. Am I missing something?
(Also not sure if this better for the Strapi-admin category. Feel free to move it.)
You are correct on both points (location of the question and how the error is shown)
Let me ping @soupette or @HichamELBSI to see if they have any suggestions but I think it would be great to add something to the core via a PR if you are willing.
Summarizing your question/request: add some kind of universal symbol next to field if it’s marked as required. (I think a red asterisk is a good idea)
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
Any development here? I’d also like to mark a field with a CSS border colour style to draw attention to missing information the editor role needs to fill out.
I want to have the * for the required field? I tried this by adding a new file at extensions/strapi-plugin-content-manager/admin/src/components/Inputs/index.js and copy the content from the node_modules/strapi-plugin-content-manager/admin/src/components/Inputs/index.js. Make below changes in the code:-