Get username in custom user twig template I have a twig template for the compact display of a user where I am able to output the defined content fields. Is there a way to output the username of that user?
The display name is not a field you can configure in {{ content }}. You can get it directly from the user entity:

{{ user.displayname }}


Reference for the php method: AccountInterface::getDisplayName