Preheat oven to 350F. Add the flour, baking powder, xanthan gum and salt to a bowl and whisk together, then set aside.
Separate the eggs, and set yolks aside. Whip up the egg whites until you have soft peaks.
Add the swerve to the egg yolks and mix. Then add the vanilla, coconut extract and unsweetened coconut milk and continue mixing.
Add the dry ingredients into the wet and mix by hand. Then fold in the egg whites until combined. Scoop into cupcake silicone liners or paper liners.
Bake for 18-20 minutes or until a toothpick, when inserted, comes out clean. Allow to cool completely before frosting.
To Make the Frosting:
Whip the mascarpone and cream cheese together in a bowl using a hand mixer. Add most of the unsweetened coconut milk (reserving about a tablespoon), swerve confectioners (or powdered erythritol) coconut and vanilla extracts and mix until smooth and creamy. Add more of the coconut milk if needed, to get your desired consistency.
Add the frosting to a piping bag (ziplock bag with the tip cut off will work too), and chill in the fridge until the cupcakes have cooled completely.Enjoy with or without the flaked coconut topping!
The unsweetened coconut milk in the cupcakes are the (thick) solids that rise to the top of a can that has been refrigerated overnight.