Preheat your oven to 350°F (175°C).
Grease two round 9-inch cake pans with butter or cooking spray.
In a mixing bowl, whisk together flour, sugar, baking powder, and salt until combined.
In another bowl, cream softened butter until fluffy using an electric mixer.
Add eggs one at a time and mix well after each addition.
Gradually pour in coconut milk while mixing on low speed.
Fold in crushed pineapple and shredded coconut gently with a spatula.
Evenly divide the batter between prepared pans.
Bake for 25-30 minutes or until golden brown and a toothpick inserted comes out clean.
Let them cool completely before removing from pans.
For the frosting, beat together softened butter and powdered sugar until creamy.
Add vanilla extract and lime juice if using; mix until smooth.
Once cooled, place one layer on a serving plate.
Spread frosting generously on top before adding the second layer.
Frost the top and sides of the cake evenly.
Decorate with extra shredded coconut or pineapple slices if desired.