Line the square pan with parchment paper, leaving some overhang for easy removal.
In a dry skillet over medium heat, toast the coconut flakes, shaking the pan often, until golden and fragrant—about 3-4 minutes. Remove from heat and let cool slightly.
Place the dark chocolate in a microwave-safe bowl and microwave in 30-second bursts, stirring well after each, until smooth and shiny.
In a large mixing bowl, combine the toasted coconut, melted chocolate, sweetened condensed milk, melted butter, and vanilla extract. Stir thoroughly until everything is evenly coated and the mixture is thick and sticky.
Transfer the mixture to your prepared pan. Use a spatula or the back of a spoon to press it evenly into the corners and create a smooth top.
Cover the pan with plastic wrap and refrigerate for at least 2 hours, or until the mixture is firm and set.
Once chilled, lift the block out of the pan using the parchment overhang. Place on a cutting board and cut into bars or squares with a sharp knife.
For clean cuts, wipe the knife with a damp cloth between slices. Let the bars sit at room temperature for about 10 minutes before serving to soften slightly.
Enjoy these rich, chewy bars with a glossy chocolate topping and toasted coconut aroma. Store leftovers in an airtight container in the fridge for up to a week or freeze for longer storage.