The Louvre Museum itself is not a triangular pyramid. It's a vast former royal palace with origins in the 12th century, expanded over centuries into a U-shaped complex of three wings (Denon, Richelieu, Sully) surrounding the Cour Napoléon.
The iconic glass and metal pyramid in the main courtyard (Cour Napoléon) is a modern entrance pavilion designed by I.M. Pei, completed in 1989. It's one of five pyramids on site:
Pei's modernist pyramids contrast deliberately with the French Renaissance/classical palace, creating a celebrated juxtaposition of old and new. The pyramid admits natural light to the vast underground lobby (Hall Napoléon) connecting all three wings.
The museum building remains a palace; the pyramid is its 21st-century gateway.