As an outbreak of a new coronavirus causes some U.S. customers to fill up shopping carts and thin out store shelves, industry groups and experts say grocers can tamp down on "panic buying" by planning ahead and trying to stay stocked.

Grocery stores, including Costco stores, have seen a spike in sales of household items like hand sanitizer, face masks and cases of bottled water in recent weeks. Sales of shelf-stable grocery items, including fruit snacks, dried beans and pretzels, are on the rise, too, according to late-February data from Nielsen.

At U.S. stores, sales of fruit snacks were up by nearly 13%, dried beans were up 10% and pretzels were up 9% in the week that ended Feb. 22, according to Nielsen data. Sales of energy drinks, pet medicine, vitamin supplements and first-aid kits also saw sales spike.

Doug Baker, vice president of industry relations at food retailer trade group FMI, said U.S. shoppers have focused on buying items for prevention and preparedness. Now, in some parts of the country, they are shifting to response mode. He said they're buying longer-lasting grocery items, such as canned goods and frozen fruits and vegetables.

He said retailers are doing their best to predict and respond to such shifts.

"We have to try to understand what consumers are thinking before they think of it," Baker said. "In an event like this, you have to quickly adapt to whatever consumer demand is," he said. "And in a moment of crisis, you have some idea of the demand that may peak, but you don't know the magnitude to which they'll peak and the geographies where they'll peak."