How do I create a custom handle to edit a box in the editor?

How do I go about adding a gizmo/handle to a custom gameobject so I can manipulate a rectangle around my object? Similar to sprite render or box collider. I want to be able to get the position and width/height during run time.

desc - Unity - Scripting API: BoxBoundsHandle
code - Unity - Scripting API: IMGUI.Controls.PrimitiveBoundsHandle.DrawHandle