Preheat oven to 180°C and line a 20 x 30cm baking tin with baking paper.
Melt butter in a medium-sized saucepan over low heat. Add sugar, golden syrup, cocoa and flour. Mix until combined, then add cornflakes and coconut and stir until combined.
Press mixture into prepared baking tin and bake in preheated oven for 20 minutes. Remove from oven and set aside to cool.
To prepare the topping, break chocolate into pieces and place in a microwave-safe bowl. Microwave in 30-second increments, stirring each time, until chocolate is completely melted and smooth.
Pour melted chocolate over cooled slice. Decorate with sprinkles if using.
When topping has set, remove from tin and slice into squares or triangles to serve.