Preheat the oven to 350°F (175°C). Line a cupcake pan with cupcake liners.
In a mixing bowl, whisk together the flour, baking powder, and salt. Set aside.
In another bowl, beat the softened butter and granulated sugar together with an electric mixer until light and fluffy.
Add the eggs one at a time, mixing well after each addition. Stir in the vanilla extract.
Gradually mix in the dry ingredients, alternating with the coconut milk. Start and end with the dry ingredients.
Fold in the crushed pineapple, dark rum, and shredded coconut until evenly combined.
Spoon the batter into the prepared cupcake liners, filling each about two-thirds full.
Bake in the preheated oven for 15-20 minutes, or until a toothpick inserted into the center comes out clean.
Allow the cupcakes to cool in the pan for 5 minutes, then transfer them to a cooling rack to cool completely.
While the cupcakes are cooling, prepare the frosting. In a mixing bowl, beat the softened butter until creamy. Gradually add the powdered sugar, mixing well after each addition.
Mix in the coconut milk and dark rum until the frosting is smooth and creamy.
Once the cupcakes are completely cooled, frost them generously with the coconut rum frosting.
Top each cupcake with toasted coconut flakes for an added tropical touch.