In a heatproof bowl, whisk together the eggs and sugar until the sugar is dissolved and the mixture is well combined.
Add the coconut milk and salt to the egg mixture, and whisk until smooth.
If using pandan leaves, add them to the mixture.
Place the bowl over a pot of simmering water (double boiler method) and cook the mixture, stirring constantly, for about 30-45 minutes or until the kaya thickens to a jam-like consistency.
Remove the pandan leaves and allow the kaya to cool completely. Transfer to a jar and refrigerate.
Preheat a skillet or griddle over medium heat.
Spread a generous amount of softened butter on both sides of each slice of bread.
Toast the bread slices in the skillet until golden brown and crispy on both sides.
Spread a generous layer of kaya on one side of each toasted bread slice.
Place another slice of toasted bread on top to make a sandwich.
Cut each sandwich into halves or quarters, if desired.
Enjoy your meal!