Three fixing methods hold a shelf with nothing visible under it: steel rods driven into the studs with matching holes bored into the shelf's back edge, a hidden batten frame that a hollow shelf sleeves over, or a steel plate with a wall flange and a blade let into a routed slot. All three depend on landing in solid timber. A floating shelf is the most common thing hung on drywall anchors and the most common thing to come off a bathroom wall, because the load levers the fixing outward rather than hanging from it.
Depth costs more than weight does. A load at the front of a 300mm shelf pulls on the top fixings about twice as hard as the same load at 150mm, so rods carrying towels on a 200mm shelf will slowly rotate a 400mm one. Past roughly 250mm, honest floating stops and the shelf wants a continuous batten or visible brackets. Span behaves the same way: a 30mm timber shelf under constant load over more than about 800mm unsupported takes a permanent set that unloading does not reverse.
Material choice comes down to edges and the underside. Sealed solid timber, exterior or marine-grade plywood with a finished edge, solid surface, porcelain and powder-coated steel all cope. Laminate-wrapped board fails where the wrap terminates and water stands. Inside a shower the underside is the wet face, and a shelf proud of the tile creates a horizontal joint in the line water already runs down.
The limit is worth stating plainly. Open shelving looks calm in photographs because the photograph holds three objects. A working bathroom holds bottles with labels, and every horizontal surface gathers a film of dust, humidity and aerosol that is wiped off item by item rather than shut behind a door. Anything within a couple of metres of a toilet catches what flushing puts into the air. Open shelves suit towels and daily items, but they are a poor choice as a room's main storage.
