Would you get a notification on your iPhone if your Apple ID was used to log into another device?

I'm unsure if I have unknowingly given my Apple ID to a scammer in the past, but I curious would I have received a notifcation on my iPhone, in a form of a text or pop up? I've heard that before and I wanted to make sure. Even if you didn't have two-factor authentication on.

Definitely if you have 2FA, I think you got an email after the fact otherwise.

If you are ever in doubt about who has your Apple ID, change your Apple ID password. You'll have to sign back in but it'll kill any open authorizations.

Yes it would.