1. Pour the coconut milk (or heavy cream) into a medium saucepan and sprinkle the gelatin over it. Let sit for 10 minutes. Add the sugar and chocolate and whisk over medium-low heat until the gelatin dissolves and the chocolate melts. Remove from the heat and stir in the vanilla.

  2. Set a strainer over a large bowl and pour the chocolate mixture into it. Use a rubber spatula to press the mixture through the strainer.

  3. Pour the strained mixture into six 1/3-cup molds, ramekins, or custard cups. Cover with plastic wrap and refrigerate for 2 hours, or up to 12 hours.

  4. Serve in the ramekins, as shown, garnished with whipped cream and shaved chocolate. Or if you wish, set the molds in a bowl of warm water for 1 minute. Invert onto serving plates, tapping the base of the mold until the panna cotta releases. Serve chilled.

  5. Store in the refrigerator, covered, for up to 1 week.