01 - Preheat oven to 350°F. Line a 12-cup muffin tin with patriotic cupcake liners.
02 - Whisk together the flour, baking powder, and salt in a bowl.
03 - Beat softened butter and granulated sugar with an electric mixer until light and fluffy. Add eggs one at a time, mixing well after each addition. Blend in vanilla extract.
04 - Add the flour mixture to the batter in thirds, alternating with milk. Begin and end with the flour, mixing until just combined. Do not overmix.
05 - Divide the batter evenly among cupcake liners. Bake for 18 to 20 minutes, or until a toothpick inserted in the center comes out clean. Cool completely on a rack.
06 - Beat butter in a bowl until creamy. Gradually add powdered sugar, milk, and vanilla extract. Beat on high speed until fluffy and smooth.
07 - Divide frosting evenly into three bowls. Tint one bowl red, one blue, and leave one white. Using a large star piping tip, fill a piping bag with alternating spoonfuls of each color to create a swirl.
08 - Pipe tall, decorative swirls of buttercream onto the cooled cupcakes. Sprinkle with red, white, and blue sprinkles. Top with star-shaped candies if desired. Place festive toppers or sparklers just before serving and remove before eating.