panel
panel copied to clipboard
JSON Pane does not align nicely with widgets
Panel: 0.13.1

import panel as pn
pn.extension(sizing_mode="stretch_width")
pn.widgets.TextInput(value="Hello World", name="Input").servable()
pn.pane.JSON(object={"key": "value"}).servable()
It is friction that the user has to figure out how to align these them selves.
The above is just an example. The wish is that the JSON pane aligns nicely for fixed and stretch_width sizing_modes as well as in Column and Row layouts.
Workaround: margin=(10,10)

import panel as pn
pn.extension(sizing_mode="stretch_width")
pn.widgets.TextInput(value="Hello World", name="Input").servable()
pn.pane.JSON(object={"key": "value"}, margin=(10,10)).servable()
Basically this is true of all panes, since widgets have a default margin of (5, 10) but (almost) all panes have a default margin of 5. Would have to decide whether to unify this.