Line a 9-by-5-inch loaf pan with parchment. Pulse cashews in a food processor until finely chopped with some small chunks remaining. Add apricots, dates, cashew butter, vanilla, and salt; pulse until ingredients start to stick together. (Do not process until smooth, as the texture helps the bars hold together.)
Transfer mixture to prepared pan and use a sheet of parchment to press and flatten evenly into pan. Sprinkle coconut on top, if desired, then cover pan with parchment or plastic wrap. Refrigerate for at least 1 hour before slicing. Store in an airtight container in refrigerator for up to 5 days, or freeze for up to 1 month.