She was the first black woman to write a play performed on Broadway. Her best-known work, the play A Raisin in the Sun, highlights the lives of Black Americans living under racial segregation in Chicago. Hansberry's family had struggled against segregation, challenging a restrictive covenant and eventually provoking the Supreme Court case Hansberry v. Lee. The title of the play was taken from the poem "Harlem" by Langston Hughes: "What happens to a dream deferred? Does it dry up like a raisin in the sun?"

After she moved to New York City, Hansberry worked at the Pan-Africanist newspaper Freedom, where she dealt with intellectuals such as Paul Robeson and W. E. B. Du Bois. Much of her work during this time concerned the African struggle for liberation and their impact on the world. Hansberry has been identified as a lesbian, and sexual freedom is an important topic in several of her works. She died of cancer at the age of 34.