Prepare the vegetables:
Shred the cabbage and carrots using a knife, mandoline, or food processor. Thinly slice the red onion if using. Place all vegetables in a large mixing bowl.
Make the dressing:
In a small bowl, whisk together the mayonnaise, apple cider vinegar, Dijon mustard, sugar, salt, and black pepper until smooth and well combined.
Combine the coleslaw:
Pour the dressing over the shredded vegetables. Toss well to ensure everything is evenly coated.
Chill and serve:
Cover the bowl and refrigerate the coleslaw for at least 30 minutes to allow the flavors to meld. Serve chilled as a side dish or topping for sandwiches and burgers.