Tim McGreevy has worked in the bean business for more than 30 years. But when he scanned the bean aisles at a grocery store in Pullman, Wash., on Sunday, he saw something he had never seen before: empty shelves.

“In one sense, this is like my best dream,” said Mr. McGreevy, who runs a trade group for producers and packagers of pulses, a category of legumes that includes beans. “In another sense, you go, ‘Wow, this is pretty serious.’”

As the coronavirus pandemic upends daily life across the United States, Americans are filling their pantries with long-lasting essentials — pasta, rice, canned meat, even oat milk.

But amid all the panic shopping, the growing demand for beans has stood out as an especially potent symbol of the anxious and uncertain times. At supermarkets, shoppers are stocking up on canned beans from familiar brands like Goya Foods, as well as thick bags of dry beans that usually lie largely untouched on store shelves.