class sap.m.HBox

Control sample: sap.m.HBox
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Extends: sap.m.FlexBox
Module: sap/m/HBox
Application Component: CA-UI5-CTR

The HBox control builds the container for a horizontal flexible box layout. HBox is a convenience control, as it is just a specialized FlexBox control.

Note: Be sure to check the renderType setting to avoid issues due to browser inconsistencies.


Constructor

Constructor for a new HBox.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

This class does not have its own settings, but all settings applicable to the base type sap.m.FlexBox can be used.

new sap.m.HBox(sId?, mSettings?)
Param Type Default Value Description
sId? string

id for the new control, generated automatically if no id is given

mSettings? object

initial settings for the new control

Borrowed Properties

Name Type Default Value Description
alignContent sap.m.FlexAlignContent Stretch

Determines the layout behavior of container lines when there's extra space along the cross-axis.

Since: 1.36.0.

Visibility: public
alignItems sap.m.FlexAlignItems Stretch

Determines the layout behavior of items along the cross-axis.

Visibility: public
backgroundDesign sap.m.BackgroundDesign Transparent

Defines the background style of the sap.m.FlexBox.

Since: 1.38.5.

Visibility: public
direction sap.m.FlexDirection Row

Determines the direction of the layout of child elements.

Visibility: public
displayInline boolean false

Determines whether the sap.m.FlexBox is in block or inline mode.

Visibility: public
fitContainer boolean false

Determines whether the sap.m.FlexBox will be sized to completely fill its container. If the sap.m.FlexBox is inserted into a Page, the property 'enableScrolling' of the Page needs to be set to 'false' for the FlexBox to fit the entire viewport.

Visibility: public
height sap.ui.core.CSSSize empty string

The height of the sap.m.FlexBox. Note that when a percentage is given, for the height to work as expected, the height of the surrounding container must be defined.

Since: 1.9.1.

Visibility: public
justifyContent sap.m.FlexJustifyContent Start

Determines the layout behavior along the main axis.

Visibility: public
renderType sap.m.FlexRendertype Div

Determines whether the layout is rendered as a series of divs or as an unordered list (ul).

We recommend to use Bare in most cases to avoid layout issues due to browser inconsistencies.

Visibility: public
width sap.ui.core.CSSSize empty string

The width of the sap.m.FlexBox. Note that when a percentage is given, for the width to work as expected, the width of the surrounding container must be defined.

Since: 1.9.1.

Visibility: public
wrap sap.m.FlexWrap NoWrap

Determines the wrapping behavior of the flex container. This property has no effect in older browsers, e.g. Android Native 4.3 and below.

Since: 1.36.0.

Visibility: public

Borrowed Aggregations

Name Cardinality Type Description
items 0..n sap.ui.core.Control

Flex items within the flexible box layout


Methods Overview

Method Description
sap.m.HBox.extend

Creates a new subclass of class sap.m.HBox with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.m.FlexBox.extend.

sap.m.HBox.getMetadata

Returns a metadata object for class sap.m.HBox.

sap.m.HBox.extend

Creates a new subclass of class sap.m.HBox with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.m.FlexBox.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

sap.m.HBox.getMetadata

Returns a metadata object for class sap.m.HBox.