Tech entrepreneur Andrew Yang, who campaigned on giving every American a universal basic income of $1,000 a month, dropped his Democratic presidential bid after a weak showing in the New Hampshire primary.

While Mr. Yang was never one of the front-runners for the nomination, he consistently ranked among the top 10 candidates in polls, ahead of sitting senators and House members.

Mr. Yang’s promise of $12,000 a year for everyone was known as the Freedom Dividend. He said it would help offset growing automation in the workplace, which he said be believed was the most urgent threat to Americans.

He was fueled, in part, by a group of online supporters who referred to themselves as the Yang Gang. The group was active in sharing news about Mr. Yang and pushing journalists to give the candidate more positive coverage.

Mr. Yang drew support in part from former supporters of Vermont Sen. Bernie Sanders. Some of those voters said that they had supported Mr. Sanders’s run for president in 2016 but that his success in pulling the party to the left had cost him his outsider status. They saw Mr. Yang as his antiestablishment successor.