Usually, the roof is made of two metal parts that fold and store themselves in the trunk when in convertible position. More recently, started to appear cars where all parts of the roof are transparent (made out of glass) in a kind of foldable sunroof.
This idea is not new, having been used by Peugeot before World War II and the Ford Motor Company in the 1950s with the Ford Skyliner sold for 3 years in the US market. However, unreliability and expense doomed those earlier efforts.
This approach, despite its obvious mechanical costs, is considered much more convenient in day-to-day use that the more traditional hard top used by some convertibles to replace the textile roof during rainy or winter months.
Examples of Coup?Convertible: