For a laptop, all you need is a keyboard/screen clamshell unit with a docking port for the phone where a drive would be on a typical laptop.
A tablet is pretty similar, but the dock needs to be behind the screen, which probably makes a thicker than average tablet. Or you just make a foldable phone which folds out to a tablet.