Different twig template for user profiles of different role I would like to theme user profile pages differently based on the role but I can't figure it out how to do so.

I will need when someone is viewing an administrator profile this twig file to be loaded:
user--administrator.html.twig

and when is viewing an editor profile this:
user--editor.html.twig

Any idea how can I achieve this?
It can done by adding a hook theme suggestion based on roles in your YOUR_THEME.theme file

/**
 * Implements hook_theme_suggestions_user_alter().
 */
function YOUR_THEME_theme_suggestions_user_alter(array &amp;$suggestions, array $variables) {
  foreach ($variables['elements']['#user']-&gt;getRoles() as $role) {
    $suggestions[] = 'user__' . $role;
  }
}


Then you can use templates like user--administrator.html.twig, user--editor.html.twig