HSpacer#
The HSpacer layout provides responsive horizontal spacing.
Use pn.ui.HSpacer to create this component.
API#
.. py:class:: HSpacer(refs=None, **params) :module: panel.layout.spacer
The HSpacer layout provides responsive horizontal spacing.
Using this component we can space objects equidistantly in a layout and allow the empty space to shrink when the browser is resized.
How-to: https://panel.holoviz.org/how_to/layout/spacing.html#spacer-components
:Example:
pn.Row( … pn.layout.HSpacer(), ‘Item 1’, … pn.layout.HSpacer(), ‘Item 2’, … pn.layout.HSpacer() … )
.. !! processed by numpydoc !!
Parameter Definitions
Parameters inherited from:
:class:`panel.viewable.Layoutable`: align, aspect_ratio, css_classes, design, height, min_width, min_height, max_width, max_height, margin, styles, stylesheets, tags, width, width_policy, height_policy, visible
:class:`panel.viewable.Viewable`: loading
sizing_mode = Parameter(constant=True, default='stretch_width', label='Sizing mode', readonly=True)
How the component should size itself.
This is a high-level setting for maintaining width and height
of the component. To gain more fine grained control over
sizing, use ``width_policy``, ``height_policy`` and
``aspect_ratio`` instead (those take precedence over
``sizing_mode``).
``"fixed"``
Component is not responsive. It will retain its original
width and height regardless of any subsequent browser
window resize events.
``"stretch_width"``
Component will responsively resize to stretch to the
available width, without maintaining any aspect ratio. The
height of the component depends on the type of the
component and may be fixed or fit to component's contents.
``"stretch_height"``
Component will responsively resize to stretch to the
available height, without maintaining any aspect
ratio. The width of the component depends on the type of
the component and may be fixed or fit to component's
contents.
``"stretch_both"``
Component is completely responsive, independently in width
and height, and will occupy all the available horizontal
and vertical space, even if this changes the aspect ratio
of the component.
``"scale_width"``
Component will responsively resize to stretch to the
available width, while maintaining the original or
provided aspect ratio.
``"scale_height"``
Component will responsively resize to stretch to the
available height, while maintaining the original or
provided aspect ratio.
``"scale_both"``
Component will responsively resize to both the available
width and height, while maintaining the original or
provided aspect ratio.