They’re super compact just wide enough to go around the toilet so you should be fine
Honey-Can-Do 4-Tier Space Saver Shelf, Chrome, 24.02" L x 11.02" W x 67.72" H https://www.amazon.com/dp/B00R3FTN1M/ref=cm_sw_r_cp_api_glt_fabc_GBNTC4MET10WETDNGPK2?_encoding=UTF8&psc=1
Rather than put a shelf between the toilet and the laundry, you could could put a shelf above the toilet instead. You could either do hanging shelves, or a over-the-toilet cabinet.
Here’s a cheap one off Amazon, but you can also find nicer ones built out of real wood.