Question about DIYing a Pottery barn under bed storage knockoff

Ilene
by Ilene

What prevents the box spring (and mattress) from sliding off the storage unit? Could I use IKEA units? Thank you.