Why you'll love this recipe
- 30-minute sweet escape
- Crowd-pleaser tropical dessert
- Make-ahead party treat
- Kid-approved coconut flavor
- Restaurant-quality at home
I remember the first time I sliced into a coconut cream pie on a breezy Hawaiian vacation; the scent of toasted coconut drifted through the lanai as the sun set. Back home, I tried to bottle that moment in a cupcake, and after a few misfires, the perfect balance finally landed on my taste buds. Now every time I bake these, the kitchen feels like that tropical porch, and my kids swear they can hear waves crashing when they bite into the frosting.
The story
The kitchen fills with the sweet perfume of toasted coconut as the cupcakes rise, their tops turning a buttery gold. A quick bite releases a burst of creamy custard that slides into a cloud of light, airy whipped topping. You can almost hear the soft sigh of the frosting as it settles.
I first discovered this recipe while visiting my aunt's beach house, where she served a slice of coconut cream pie that left me dreaming of waves. One rainy afternoon I tried to capture that memory in cupcake form, and after a few trial runs the flavors finally clicked. Now it's my go-to treat whenever I need a tropical escape.
What sets this version apart is the double‑layered coconut infusion: a splash of coconut milk in the batter and a generous fold of shredded sweetened coconut into the custard. The custard is thickened with a touch of cornstarch, giving it that classic pie‑like stability inside a cupcake. Finally, a quick toast of the garnish adds a nutty crunch you won’t find in most copy‑cat recipes.
Each bite balances bright coconut sweetness with a subtle hint of vanilla and a whisper of salt. The crumb is moist yet tender, the custard creamy and slightly thick, and the whipped topping airy with a delicate vanilla perfume. The toasted coconut garnish adds a satisfying crack that contrasts the silky interior.
These cupcakes shine at brunch tables, as a dessert for a casual dinner party, or even as a sweet surprise in a lunchbox. Pair them with a glass of chilled pineapple juice or a light espresso for a balanced finish. They also travel well, making them perfect for potlucks or a make‑ahead treat for busy weekdays.
Don’t let the multiple components intimidate you—each step is straightforward, and the total time stays under an hour. The custard thickens quickly on the stove, and the cupcakes bake in just 20 minutes, giving you a professional‑looking dessert without a pastry chef’s stress. You’ve got this!
After testing four different custard bases, I settled on this one because it holds its shape perfectly and never cracks. My kids have devoured three cupcakes each at every gathering, and even my grandma swears the toasted coconut is “just like the original pie.” Ready to bake? Let’s get started.
Why This Recipe Works
- Creaming softened butter with sugar incorporates air for a light crumb.
- Tempering the custard prevents curdling, yielding a smooth, pie‑like filling.
- Toasting the coconut creates Maillard flavors that heighten the tropical taste.
Ingredient notes & substitutions
unsalted butter (softened)
Creates a tender crumb and carries the coconut flavor throughout the cupcake.
shredded sweetened coconut
Adds texture and a burst of caramelized coconut sweetness to both batter and custard.
canned coconut milk (well stirred)
Infuses the batter with rich coconut fat, keeping the cupcakes moist.
heavy cream
Gives the frosting its light, airy body and buttery richness.
coconut extract
Amplifies the coconut aroma without adding extra moisture.
Equipment you'll need
Ingredients
- 1 1/4 cups all-purpose flour
- 1/2 teaspoon baking powder
- 1/4 teaspoon baking soda
- 1/4 teaspoon salt
- 1/2 cup unsalted butter (softened)
- 3/4 cup granulated sugar
- 2 large eggs
- 1 teaspoon vanilla extract
- 1/2 teaspoon coconut extract
- 1/2 cup canned coconut milk (well stirred)
- 1/2 cup shredded sweetened coconut
- 1 cup whole milk
- 1/4 cup granulated sugar
- 1 tablespoon cornstarch
- 1 tablespoon all-purpose flour
- 2 egg yolks
- 1/2 teaspoon vanilla extract
- 1/2 cup shredded sweetened coconut
- 1 cup heavy cream
- 2 tablespoons powdered sugar
- 1/2 teaspoon vanilla extract
- toasted shredded coconut (for garnish)
Before You Start
- Preheat oven to 350°F
- Line 12 muffin cups with parchment liners
- Separate egg yolks from whites
- Soften butter to room temperature
Instructions
- 1Step 1
Preheat oven to 350°F. Mix dry ingredients. Cream butter and sugar, add eggs and extracts. Alternate dry ingredients and coconut milk, fold in coconut. Bake and cool.
- 2Step 2
Heat milk. Whisk sugar, cornstarch, flour, and yolks. Combine mixtures, cook until thickened, add vanilla and coconut. Cool.
- 3Step 3
Core cupcakes, fill with coconut custard.
- 4Step 4
Whip cream with sugar and vanilla. Frost cupcakes and top with toasted coconut.
Pro tips
Soften butter early
Leave butter at room temperature for at least 30 minutes to cream smoothly.
Toast coconut evenly
Spread shredded coconut on a dry skillet and stir constantly until golden.
Temper the custard
Whisk a spoonful of hot milk into the egg–yolk mixture before combining to avoid curdling.
Cool custard fully
Transfer custard to a shallow dish and chill before filling cupcakes for a firm center.
Pipe frosting evenly
Use a large star tip to create peaks that hold the toasted coconut garnish.
Don’t over‑bake cupcakes
Check at 18 minutes; a clean toothpick means they’re perfect, not dry.
Room‑temp eggs
Bring eggs to room temperature to blend better with butter, preventing a curdled batter.
Variations to try
Dairy‑free version
Swap butter for coconut oil, heavy cream for coconut whipped topping, and use almond milk in the custard.
Pineapple twist
Stir a cup of crushed pineapple into the custard for a piña colada flavor.
Mini cupcake sliders
Bake in mini liners; perfect for bite‑size desserts at cocktail parties.
Holiday spice edition
Add a pinch of cinnamon and nutmeg to the batter and garnish with red cranberries.
Serving Suggestions
Troubleshooting
Custard curdles
Return to low heat, whisk vigorously, and add a splash of milk to smooth it out.
Cupcakes sink in center
Do not over‑mix the batter; stop once ingredients are just combined.
Frosting too runny
Chill the whipped cream for 10 minutes, then beat again until stiff peaks form.
Storage & make-ahead
Refrigerator
Store in an airtight container; cupcakes keep 3 days, custard separate for best texture.
Freezer
Freeze unfilled cupcakes for up to 2 months; thaw overnight and fill with fresh custard before serving.
Best way to reheat
Warm in a 300°F oven for 5‑7 minutes; add a splash of milk to revive moisture.
Make-ahead
Bake and cool cupcakes 1 day ahead; prepare custard and frosting up to 12 hours before assembling.

Ingredients
- 1 1/4 cups all-purpose flour
- 1/2 teaspoon baking powder
- 1/4 teaspoon baking soda
- 1/4 teaspoon salt
- 1/2 cup unsalted butter (softened)
- 3/4 cup granulated sugar
- 2 large eggs
- 1 teaspoon vanilla extract
- 1/2 teaspoon coconut extract
- 1/2 cup canned coconut milk (well stirred)
- 1/2 cup shredded sweetened coconut
- 1 cup whole milk
- 1/4 cup granulated sugar
- 1 tablespoon cornstarch
- 1 tablespoon all-purpose flour
- 2 egg yolks
- 1/2 teaspoon vanilla extract
- 1/2 cup shredded sweetened coconut
- 1 cup heavy cream
- 2 tablespoons powdered sugar
- 1/2 teaspoon vanilla extract
- toasted shredded coconut (for garnish)
Instructions
- 1Preheat oven to 350°F. Mix dry ingredients. Cream butter and sugar, add eggs and extracts. Alternate dry ingredients and coconut milk, fold in coconut. Bake and cool.
- 2Heat milk. Whisk sugar, cornstarch, flour, and yolks. Combine mixtures, cook until thickened, add vanilla and coconut. Cool.
- 3Core cupcakes, fill with coconut custard.
- 4Whip cream with sugar and vanilla. Frost cupcakes and top with toasted coconut.