The best way to measure is to determine the width of the opening, compare it to a pre-selected door, and then follow the barn door hardware kit instructions. Choose the final trim width to ensure that the door opens fully and closes appropriately to block off the space behind.