FacelessTech designed this small board to act as a surface-mount edge connector:
So you want to joint two boards together, You decide to use through hole female and male 2.54 pitch headers. Normally you would use through hole than ether have a 90 degree headers or just bend them over. For years this is how I did it, I would have to make sure I made sure the holes were just the right distance from the edge of the board.
The KiCad design files are available on GitHub: