Thinly slice the onions. A mandoline helps. You can choose to divide the slices into numerous jars, or just place them into one large mason jar. Add the garlic and peppercorns to each jar, if using.
In a medium saucepan over medium heat, combine the vinegar, water, sugar, and salt. Stir until the sugar and salt dissolve, about 1 minute. Let the brine cool slightly, then pour it over the onions. Cool to room temperature, then refrigerate.
The onions are ready when they turn bright pink and tender. Very thin slices take about 1 hour. Thicker slices are best left overnight. Store in the fridge for up to 2 weeks.