01 - Preheat oven to 350°F. Line a 12-cup muffin pan with decorative cupcake liners.
02 - In a medium bowl, whisk together the flour, baking powder, and salt until well combined.
03 - In a large bowl, beat softened butter with granulated sugar using an electric mixer until pale and fluffy. Beat in eggs one at a time, ensuring each is fully incorporated. Mix in vanilla extract.
04 - Add the dry ingredients to the wet mixture in three parts, alternating with the milk, beginning and ending with the flour mixture. Mix on low speed until just combined and smooth.
05 - Divide batter evenly among cupcake liners, filling each about two-thirds full. Bake in preheated oven for 18 to 20 minutes, or until a toothpick inserted into the center comes out clean. Cool on a wire rack completely before frosting.
06 - Beat butter in a large bowl until creamy and light. Gradually add powdered sugar, then mix in milk and vanilla extract. Whip on high speed until frosting is fluffy and smooth.
07 - Divide the frosting into three separate bowls. Tint one portion red, one portion blue, and leave the third portion plain. Use gel food coloring to achieve deep, vibrant hues without thinning the frosting.
08 - Fill a piping bag fitted with a large star tip with alternating spoonfuls of red, white, and blue buttercream. Pipe tall swirls onto each cooled cupcake. Garnish with red, white, and blue sprinkles and optional star-shaped candies. Add sparklers or decorative toppers just prior to serving and remove before eating.