[SalesForce] “Standard” Lightning Components – How is the Required attribute used

Most of the Lightning Components in the Lightning Component reference have a "Required" attribute as one of the options.

Example Component

Given that this appears to have no impact on validations out of the box, are there best practice guidelines on how to use this?

Andy

Best Answer

It is used to set the styling on the component and set the input to required. Browsers handle the required attribute in different ways but it does signify to the browser that that input must be filled out before submitting the document to the server

You can also roll your own validations on the fields using jQuery, JS, etc on all "input:required" fields using the attribute. Not much different from when you did it in VF