Place 1 mozzarella slice, 2 tomato slices, 2 onion slices and 2 shredded basil leaves on each of 4 slices of bread. Sprinkle with salt and pepper. Top with remaining bread.
Heat oil in a large non-stick frying pan over medium heat. Add sandwiches; cook, firmly pressing down with a spatula, until lightly browned, about 2 minutes. Turn sandwiches over. Cook, pressing down, until sandwiches are browned and the cheese is melted, about 2 minutes.