That's called immediately mode gui (or imgui). It has nothing to do with think about elements or pixels. You do have elements, it's just that they're rendered directly (immediately) instead of stored.
You have a panel+border+text "primitive" drawing functions. Nothing is stopping you from creating a single function that calls all 3 of those. You probably should, since it's probably a common pattern. You could call it DrawBoxedText. There is no difference between a DrawBoxedText function and a BoxedText element with a draw() method.
The one on the right looks bigger though, it's just zoomed out.