Peel the onion, then use a mandolin (or a sharp knife) to get thin slices. Optional: Soak the onions in cold water for 20 minutes, then drain. Heat vinegar, water, sugar, and salt in a saucepan until the sugar is dissolved.
Add onions to a jar with optional peppercorns and bay leaves.
Pour hot brine over onions to cover.
Let it cool, seal, and refrigerate. Ready in 30 minutes, best after a few hours.