Small bathroom design is constrained arithmetic before it is anything else. Three numbers eliminate most layouts.

The three that matter most
15 inches from the toilet centreline to any wall or fixture on each side. That makes 30 inches of width the working minimum for the toilet zone.
21 inches of clear space in front of the toilet and in front of the vanity, with 24 preferred and required in some jurisdictions.
A door that can open. An inward-swinging door needs its swing kept clear of every fixture, and in a small room the swing frequently is the layout problem.
Local codes vary and are sometimes stricter. These are the common minimums.
The moves that buy space
A pocket or barn door, which removes the swing entirely. A pocket door needs a wall cavity with no plumbing or wiring in it, which has to be checked rather than assumed.
A round-front toilet, saving about three inches of projection over an elongated one.
A wall-hung toilet or vanity, which frees the floor visually and makes the room easier to clean. Both need framing decided at rough-in.
A shower instead of a tub, which is the largest single space gain available — a tub occupies 30 inches of width for its whole length whether it is used or not.
A corner shower in a room where a rectangular one does not fit.
A sliding shower door rather than a hinged one, which needs no swing clearance.
A shallower vanity, at 18 inches rather than 21, which is barely noticeable in use and frees three inches of the most valuable dimension.
What not to give up
The 21 inches in front of the toilet. A layout that works on paper and is uncomfortable in practice is worse than a smaller ambition.
Ventilation. A small bathroom generates the same moisture and has less air volume to absorb it, so the fan matters more rather than less.
A place to put things. A bathroom with no shelf, no ledge and no counter is unusable regardless of how well the fixtures fit.
Tricks that actually work visually
A large mirror, wall to wall, which is the single most effective thing in a small bathroom.
Continuing the floor tile into the shower, which reads as one space rather than two.
A clear glass panel rather than a curtain or frosted door, which lets the eye see the full depth of the room.
Light colours and consistent grout, which reduces visual noise more than tile size does.
Recessed storage — a mirror cabinet, a niche in the shower, a recessed toilet-roll holder — which takes nothing from the floor.
The bath question
Conventional advice is to keep at least one bath in a house for resale. That advice is worth weighing against actually using the room for the next decade.
Where the house has another bathroom with a tub, removing this one is usually the right call. Where it is the only bathroom, it is a genuine trade-off.
Where to start
Draw the room to scale, mark the three clearances as zones, and then see what fits. Most layout ideas eliminate themselves in ten minutes on paper.
Doing that before falling for a layout saves the disappointment of costing one that was never legal.
The three-fixture arrangements that recur
In a narrow room, the workable arrangements are limited and they repeat because they are the ones that satisfy the clearances.
All three along one wall — shower at the far end, toilet in the middle, vanity by the door. Efficient, and it needs the room to be long enough that the door does not conflict with the vanity.
Shower opposite the door, toilet and vanity on one side. The most common arrangement in a square-ish small bathroom.
Corner shower with toilet and vanity on adjacent walls, which suits a room too short for a full-width shower.
Anything more inventive usually violates one of the three clearances, which is why the same layouts appear over and over.
