Mac Miller, a Pittsburgh rapper who built a loyal cult fan base with low-key charisma and intimate verses, died on Friday at his home in the San Fernando Valley in California. He was 26.

His family released a statement confirming the death but said it had “no further details as to the cause of his death at this time.”

Mr. Miller had recently released his fifth full-length album, “Swimming,” which opened at No. 3 on the Billboard album chart. An early internet success story, he topped the chart with his independent debut, “Blue Slide Park,” in 2011, the first indie album to do so in 16 years.

Though he began as a mischievous party-starter, Mr. Miller, who often made his own beats, turned toward darker sounds and motifs. He rapped about substance abuse, having spoken in interviews about an addiction to prescription opiate cough syrup. And he cultivated a following with bracing lyrics about struggling with depression.