NEW YORK — When a product is hot, it can look like a surefire bet for an entrepreneur tempted to jump on the trend. The same holds true for a lawyer asked to supply the legal acumen to get the project off the ground.

A savvy strategy, though, takes into account what to do when the fad goes pfffft.

Companies of all sizes try to take advantage of fads — it’s what big toy and Halloween costume makers do when a movie like “Star Wars” or “Frozen” comes out. But a craze can come to a sudden end when something else grabs the attention of fickle consumers or a better product takes its place.

Small business owners and their lawyers need to think not only about how to sell a hot product, but how they’ll handle the likelihood of a limited shelf life.

“Don’t assume your fad is going to have revenue beyond a pretty short time,” said Mary Gale, a lecturer in entrepreneurship at Babson College in Wellesley, Mass. “Plan for the demise of that business and don’t fool yourself about when it’s going to be.”

A look at the strategies of four small businesses:

Ready to pivot

The popularity of “Minecraft” inspired Lindsey Handley to create software and afterschool programs to teach children computer skills using the video game. Her company, ThoughtSTEM, began developing its products in 2014.

“Minecraft” is still selling well seven years after its release, but Handley’s company created its primary software product, LearnToMod, with the understanding that it may run its course. The software’s functions can be easily adapted for another video game.

“It makes us feel a lot safer knowing if we need to pivot one day because all the kids stop playing ‘Minecraft,’ we can pivot and it will be OK,” said Handley, whose company is based in San Diego.

ThoughtSTEM is on the lookout for new games that might succeed “Minecraft,” but has already turned down adapting its software for several of them.

“By the time ‘Minecraft’ starts losing popularity, those games will be losing popularity too,” Handley said.

Looking for ways to stand out

Cafes selling bubble tea, a beverage popular in Taiwan, have proliferated across the U.S. as well, some independently owned and others part of franchise chains. When Mathew Wong and his business partners opened Tea and Milk in New York last year, they knew it was risky.

“For a long time, there was a new one opening up every day,” Wong said.

The partners developed a strategy they hope makes their shop stand out and allow it to thrive even if the popularity of bubble tea wanes. They make the bubble tea, which gets its name from the tapioca pearls in the beverage, from scratch. They also advertise it as healthier than competitors’ offerings made from factory-produced powdered tea and milk.

They also are marketing to a diverse range of customers. The store is located in Astoria, a multicultural neighborhood in New York, and the partners take their tea to flea markets and festivals around the city to introduce it to new customers.

Milk and Tea is also stocked with other popular foods like designer doughnuts. If bubble tea starts to fade, “we’ll do more research on what we can do (to survive),” Wong says.

Cupcakes as events

While cupcakes are still relatively popular, they’re available many places — from cupcake-only sellers to traditional bakeries to supermarkets. The craze has cooled from its peak, and the Crumbs chain went into bankruptcy in 2014 before being revived by an investor.

With that in mind, Barbara Hart considered how to be distinctive before she started her cupcake company late last year and designed a product that could be customized. At Create Your Cupcake, customers can pick flavors for all the components: The cake that has a hollow center, a filling, icing and toppings.

Hart believes that by offering a do-it-yourself-cupcake, she’s making the product more likely to survive if the fad fizzles. She promotes the cupcake as more than a sweet, more like an event.

Besides selling them in her Sandy Springs, Ga., bakery and online, she caters parties where adults and children get to create their own cupcakes.

Hart is also able to turn out quiches and other not-sweet foods.

Despite the name, “We’re not locked into something that could be a fad,” she said.

Flatlining fad

Five years ago, Jerry Lee began making custom leather smartphone cases, focusing all his efforts on the Apple iPhone, “simply because it was the coolest gadget in town.”

Lee, owner of Story Leather in Walnut, Calif., produced a new style of case for every version of the iPhone, and sales rose 100 percent from one year to the next. But two years ago, when the iPhone 6 was released, revenue started slowing as other phones with the Android operating system started getting more buzz; Lee’s year-over-year gains fell to 50 percent.

“I started worrying, should we base our business primarily on people buying iPhone cases?” Lee said.

His solution has been to diversify, making wallets, cardholders and other leather goods. Revenue is up about 50 percent from last year with Lee’s newer products making up for the weaker iPhone case sales. Customers often want a wallet to match a smartphone case.

Without the change in strategy, “I would be in trouble,” Lee said.