Small zucchini (about 1 inch in diameter) make the best pickles, but over-grown ones can make satisfactory pickles if they are halved, seeded, then cut into half-rings. I prefer to use the dill heads before they are completely mature and dry because of their soft flavor and appearance.
Trim the ends from the zucchini and slice about 3/8 inch thick. Halve the onions lengthwise, then slice them crosswise about 1/4 inch thick. Layer the vegetables in a glass, ceramic, or stainless steel bowl, sprinkling each layer with salt. Cover with ice water. Place a plate on top of the vegetables and a weight on the plate. Let stand for 2 hours.
Drain the zucchini and onions and rinse well. Drain again while you prepare the pickling liquid.
Mix the vinegar, water, sugar, and mustard in a large nonreactive pan. Bring the mixture to a boil, then simmer for 5 minutes. Remove the pan from the heat, add the dill heads or seed and the zucchini and onions, and cover. Let the mixture stand for 2 hours, tossing occasionally.
Meanwhile, fill a canning kettle with enough water to cover pint jars and bring the water to a boil. Sterilize four pint jars and scald four lids and rings.
Bring the zucchini mixture to a boil in its pan and stir in the garlic and dill leaves. Ladle into hot, sterilized pint jars. Cover with lids and rings and process in the boiling water bath according to manufacturer's directions for 10 minutes at sea level. Store the pickles for a week at room temperature before using. If any jars do not seal, store them in the refrigerator and use the contents within 2 weeks.