When Crumbs, the New York City-based chain that built its business around cupcakes, shuttered several dozen of its remaining locations on Monday, it seemed like an abrupt ending for a company that opened a decade ago to ride the wave of popularity of the sugary treat sparked by the TV series “Sex and the City.”

But Crumbs’ rise and fall isn’t surprising when considering the company’s dependence on a fad. In fact, it’s the latest cautionary tale for businesses that devote their entire menus to variations of a single product.

Krispy Kreme, for instance, expanded rapidly in large part on the cultlike following of its doughnuts. But sales started declining and the company ended up closing some locations. Last year, restaurant-industry researcher Technomic said Krispy Kreme had 249 locations, down from 338 a decade ago. The chain has broadened its menu more recently.

A similar fate befell Mrs. Fields, which is known for its cookies. The chain has suffered in part because of the ubiquity of places that sell cookies, and it was down to 230 stores last year, from 438 a decade ago.

TCBY had 355 stores last year, down from 1,413 a decade ago. Part of the chain’s problem is the competition, given the proliferation of frozen-yogurt places.

Companies that offer only one item can fall victim to a number of risks. For one, trendy products tend to attract competition from big and small players that want to jump on the bandwagon.

For instance, Starbucks and Cold Stone Creamery have been trying to capitalize on the cupcake trend with cake pops and ice-cream cupcakes, respectively.

Being beholden to a single item also makes companies more susceptible to customers’ whims and changing tastes. There’s always a new fad. Frozen yogurt. Chopped salads. Freshly squeezed juices. Entrepreneurs may be eager to open stores selling these products, but there’s always the danger that fickle customers will move on to the next thing.

To combat the risks, many chains diversify their menus. And several have prospered by moving beyond their flagship products.

Dunkin’ Donuts, for instance, has been pushing aggressively into specialty drinks and sandwiches, with a focus on boosting sales after its morning rush hour.

And Starbucks has introduced a range of new foods and drinks in its cafes, including premium bottled juices and salad boxes. The coffee chain even plans to expand wine and beer offering in evenings to as many as 1,000 locations over the next several years.

Magnolia, another popular New York City cupcake shop, is credited for sparking the cupcake craze after it was featured in “Sex and the City.”

The chain, which opened in 1996, has endured while many of the cupcake shops that opened up in its wake — including Crumbs — focused on just cupcakes.

That’s in part because Magnolia, which now has seven U.S. locations, offers a variety of desserts, including cakes, pies, cookies, brownies and banana pudding.

Sara Gramling, Magnolia’s spokeswoman, said the company is learning about the dangers of focusing too heavily on one product, as well as expanding too quickly.

“We’ll be mindful of those lessons,” she said.

Cupcake Royale, perhaps Seattle’s best-known cupcake seller, opened in 2003. Jody Hall, its CEO, said she has avoided over-expanding the way Crumbs did.

“People have asked me to open in Portland or San Francisco or Dubai. I do not want to do that,” she said. “We have never been a fast grower, we have been an organic grower — let our cash drive our growth.”

There are six Cupcake Royale locations in the Seattle area; the most recent opened last fall on Queen Anne.

Hall, without giving details, said Cupcake Royale last week had its best week of sales ever.

She said Cupcake Royale added ice cream to its menu two years ago, helping to broaden the business and keep it sustainable.

Jennifer Shea, owner of Trophy Cupcakes, said she has kept the company to four locations in Seattle and Bellevue in order to control the quality of each batch of cupcakes.

“Life is too short for bad cupcakes,” she said.

There are not many bakeries that have grown on a national level while keeping the same quality they had when they first started, said Shea.

Still, some specialty chains manage to persevere by carving out a niche where there aren’t many competitors; Auntie Anne’s and Cinnabon have expanded locations over the years.

As for Crumbs, the company noted in a statement late Monday that it was evaluating its “limited remaining options.” That will include a Chapter 7 bankruptcy filing. Crumbs did not provide comment beyond its statement.

Seattle Times business reporter Brandon Brown contributed to this story.