I have configured a record page (say for Contact) in lightning app builder. On the left panel, I am showing a related list of certain records under a tab. On the right panel, I have a custom component. When user will click on a record on the related list, I want to show some details related to that record in the custom component. So, actually, I need a way to pass the recordId to the custom component, when clicking a record in the related list. Is it possible in any standard or custom way?
Not if you are using the OOTB Related list, as there is no way of triggering an event when the record is selected, you will most likely need a Custom Related List Component, allongside a custom event in order to communicate with your already build custom component.
Usually, When a user clicks on a record from the related list, the interface redirects to that record.
If your component is embeded in the interface of the "related record" then you can use
implements="force:hasRecordId" to Build Context-Aware Lightning Components