Prepare your lids and rings, water bath, and brine. Bring the water bath and brine to a boil as the jars and beans are prepared.
Divide the sliced onion between the bottom of each sterilized jar — adjust the amount to your own preference. Take one bean, and using the jar as a guide, trim it to within ½ inch of the top (this leaves the right amount of headspace). Use that “guide” bean to trim the rest to match.
Pack the beans into the jars standing upright, pressing gently until they’re snug. Add dill seeds on top of the beans in each jar. If you want a spicy bean, add crushed red pepper flakes to each jar as well.
In a saucepan, combine the water, vinegar, and canning salt. Bring to a boil to form the brine.
Once the water bath and brine are both boiling, ladle the hot brine over the beans in each jar, leaving ½ inch of headspace. Place the prepared lids and rings on the jars and lower them into the water bath. Process for 12 minutes once the water returns to a full boil.
After processing, use a jar lifter to remove the jars from the water. Let them rest undisturbed for 12–24 hours before removing the rings.