Rub a lime wedge around the rim of a margarita glass, then dip it into coarse salt or sugar until evenly coated.
Add the dragon fruit, tequila, triple sec, fresh lime juice, and agave syrup to a blender.
Blend for about 20–30 seconds, just until the mixture becomes smooth and bright pink. Avoid over-blending to keep the color vibrant.
Taste the mixture. Add a little more agave if it's too tart or another squeeze of lime if it's too sweet.
Fill the prepared glass with fresh ice if serving on the rocks. For a frozen margarita, blend with an extra handful of ice instead.
Pour the margarita into the glass. The drink should look silky, vibrant, and free of large fruit pieces.
Garnish with a lime wheel, dragon fruit slices, or a mint leaf. Serve immediately while the color and flavor are at their freshest.