Preheat oven according to package instructions and place 24 cupcake liners into a cupcake pan.
Prepare cake mix according to package instructions and fold in the shredded coconut.
Use an ice cream scoop to evenly distribute the batter between the cupcake liners and bake for time directed on the box or until an inserted toothpick comes out clean.
Allow the cupcakes to cool for 5 minutes in the pan before transferring to a wire rack to cool completely before decorating.
If using rum, brush a coat of the liquor onto each cupcake while still warm.
To make the pineapple leaf toppers, line a baking sheet with wax paper.
Place the candy melts and coconut oil In a microwave-safe bowl and microwave in 30-second intervals until completely melted.
Pour into a piping bag and pipe out pineapple-leaf shapes. Allow the leaves to set in the refrigerator for at least 15 minutes.
Use an electric mixer to make the frosting. Place the butter, sugar, and milk on medium and gradually increase the speed to high.
Add vanilla extract and pineapple juice and continue to mix. Mix in yellow food coloring. The frosting is ready to use once the mixture forms stiff peaks.
Transfer the frosting to a piping bag fitted with a star tip and pipe swirls on top of each cupcake.
Carefully peel the candy melt leaves and insert one into each cupcake. Enjoy!