Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page is for application designers who want to set the position, size and flow of layout components.

Overview

...

Insert excerpt
_Banners
_Banners
namescreen
nopaneltrue

Overview

When designing screens we must consider how we want the page content to layout (Size and Position) but also how it should respond to its content and the screen it is being viewed on such as different sized monitors or mobile devices.

This page explains key concepts that you need to understand about how layout components can be positioned, sized and made

...

responsive

...

The videos illustrate the concepts using a screen designed using the Theme 2 palette. If you have Theme 2 installed, you can use find the example dashboard in the repository. Navigate to Packages  → Theme2 - App Builder. Right-click T2 - Example Dashboard and select Display

Tip

In the Theme 2 palette, layout components have been combined into ready-made tiles that you can drag into a dashboard. 

In the properties tab for layout components there are several sections where you can configure position, size and flow. You can change the formatting of one component. If you need to make the same change to several components, use the Shared Styles.

  • To configure the selected layout component only, use:
    • Style Settings: Auto Size, Direction and options to set scrollbars
    • Position Settings: fix the position, size and order of layout components
    • CSS Properties: configure less common CSS options, such as z-index.
  • To configure multiple components in the same way, use Shared Styles →  Basic Settings These include settings for borders backgrounds and setting scrollbars. You can set more options by adding CSS Properties to shared styles.

Positioning

Position settings can be:

  • absolute, when you want to configure a specific location for a component within its parent.  This can be useful where you want a component to always appear in the same place. For example, you may want the company logo to always appear in the top left of every screen. However, setting an absolute position prevents the component from flowing with other things on the screen.
  • relative, when you want to position the component relative to siblings. This allows items to flow or flex. Use relative positioning if you want your application layout to be responsive to different screen sizes.

Multimedia
namePositioning.mp4

Absolute or Fixed Position

...


Position

Relative Positioning (Recommended)

Setting the properties on a parent area determines how child objects are positioned. such as in a row or column. The following video describe how to position your items:

Iframe
srchttps://www.youtube.com/embed/hDbSVkHpxEM?rel=0
width650
height400

Configuration Options

In the Styles tab for an area we can set the following styles to determine how items held within the area are laid out. PhixFlow uses CSS flexbox to achieve this, for more information on using flexbox visit: a guide to flexbox

  1. Direction: the content will be laid out.
    1. Row puts components next to each other horizontally.
    2. Column puts components below each other vertically.
  2. Wrap: allows components to start a new row or column when all space is filled or the screen size changes and components need to flow onto additional rows or columns, rather than disappearing off-screen.
  3. Justify: determines where content will be placed for example, Flex Start - tells the first component to be in the top left.
  4. Align: Alignment within the are, for example Stretch - tells each component to stretch to fit the available space. If all components fit on one row, then the components extend to fill the vertical space. If components have to wrap to form a second row, each row will occupy half the vertical space.

Image Added

Position can also be set in a shared style which allows you to combine positioning with conditional formatting rules. For example,

  1. show or hide an area base on an on/off toggle.
  2. Use the Internal Variable _client.mobile which returns true if the page is being viewed on a mobile device to amend how the screen looks.

Absolute or Fixed Position

Absolute positioning stipulates the a fixed position for an item. For example, to specify a component is always positioned in the top left corner of its parent area, set Position Settings → Top0 and Left: 0.
If you have a fixed layout component combined with components that have relative positioning, be aware that:

  • the fixed component's size depends on its Position Settings → Width and Height. If no value is set it will have the default minimum size.

...

In Front or Behind Another Component

To change which component is in front/behind

...

:

  1. add a CSS Properties and set:
  2. CSS Tag:

...

  1. z-index
  2. Value

...

  1. : this is a whole number that determines how afar in front or behind an item will appear. For example items with a z-index of 20 will appear in fron f items with a value of 10. Consider using a larger increment, for example 10,

...

  1. as this provides the flexibility of adding more layers if they are needed.

Relative Position

By setting the properties on a parent area, you can determine how the child objects are positioned relative to each other.

To configure how components align, use Style Settings

  • Direction:
    • Row puts components next to each other horizontally.
    • Column puts components below each other vertically.
  • Wrap: Wrap - allows components to start a new row or column when all space is filled.  This also means when the screen size changes, the components will flow onto additional rows, rather than disappearing off-screen.

Additional style settings affect the child objects. The following settings provide very responsive design.

  • Wrap: Wrap - allows components to start a new row or column when all space is filled.  This also means when the screen size changes, the components will flow onto additional rows, rather than disappearing off-screen.
  • Justify: Flex Start - tells the first component to be in the top left
  • Align: Stretch - tells each component to stretch to fit the available space. If all components fit on one row, then the components extend to fill the vertical space. If components have to wrap to form a second row, each row will occupy half the vertical space.

There is a Theme 2 demonstration dashboard that you can use to see how this works. In the repository Packages section navigate to Theme2 - App Builder. Right-click T2 - Example Dashboard. and select Display. When you resize the screen, you can see that the different areas move to remain visible in the smaller window.

Note

When you change a layout component from flowing within its parent to having a fixed position, depending on other settings:

  • it's size may change
  • it may be behind or in front of another component.

Size

Summary of Size Settings

To control the size of layout components on a dashboard you can:

...

Size

To control the size of layout components on a screen, again we can use Relative and Absolute sizing. THe following video helps illustrate how this works:

Iframe
srchttps://www.youtube.com/embed/nyfM3hQq7gg?rel=0
width650
height400

Relative Sizing

  • Specify a size that varies as the screen resizes and always occupies the same proportion of space. 
    Set a percentage in Position Settings → Width and Height with value% e.g. 75%..
  • Allow the layout component to automatically expand to fit the visible space on screen.
    Set Style Settings → Auto Size ticked.
    • If the layout component has siblings (components at the same level) they share the space in the flow direction equally.
      (To specify the flow direction, in the parent component

...

    • set Style

...

    • Settings → Direction.)
    • Child components may need more space than is available. For example, they may contain more fields than will fit on a screen. In this case the fields will extend outside the boundaries of the parent area.
  • Control how much a layout component will expand compared to its siblings using a ratio
    Set a Style Settings → Grow Factor

...

  • . For example, enter 2 to allow a component to take up twice the space as its siblings.
  • Allow layout components to expand to the space they need, pushing the parent container to expand beyond the screen.
    Set Style Settings → Auto Size unticked.
    Remember to enable scroll bars on the parent container using Style Settings → Show Horizontal Scrollbar and Show Vertical Scrollbar.

The following video shows how the different settings affect layout components in a dashboard.

Multimedia
nameSizingObjects.mp4

To set the size of  layout component, in its properties →  Position Settings, set the Width and Height of the component. You can specify:

  • a percentage, for example 60%, so that the component always occupies the same proportion of the available screen space
  • a number of pixels, for example 600px. The component always occupies this amount of space, even as the screen changes size.

How adjacent components behave depends on:

  • whether or not the child component has Style Settings → Auto Size set
  • The flow direction (row or column) set in the parent component.

When all 

  • With autosize, the component expands to fill the available space.
  • Multiple components in the same row or column share the available space equally.
  • other component - if it has a minimum or fixed width set or also has autosize 

In the video, 2 components with autosize each take up 50% of the row. When the map does not have autosize, it takes up its minimum space whilst the tile to its left expands to fill the available space.

Components only "grow" in the direction in which the parent allows them to flex. For example, if the parent has a Direction of Row, components adjust to fit the width available in the row. if the parent has a Direction of Column, components adjust to fit the height availbable in the column.

Growth factor the default is for PhixFlow to size components equally, which is the equivalent to a ratio of 1:1. To change that ratio, you can use the Grow Factor option. By setting this to 2, you are telling PhixFlow to size the component to be twice the size (in the grow direction) as other components.

Child objects can push the size of the parent object, for example if you do not know how many fields there will be and you want the area to expand to accommodate the fields.

  1. Parent container area set to autosize
  2. Child area for example of a component is much taller, the parent area expands to accommodate the height of the child.

With autosize set note that

A single empty area component  in a dashboard will automatically fill all the dashboard space, even though it is empty

...

  • Allow a layout component to change it's size within a minimum and/or maximum range.
    In CSS Properties set CSS Tag: min-height or max-height and Value: valuepx e.g. 45px.

Absolute

  • Specify a fixed size in pixels.
    Set Position Settings → Width and Height with valuepx.


Tip

Remember that with auto size set:

A single, empty area component on a screen will automatically expand to fill all the available screen space, even though if it is empty. It does not expand to accommodate all its content.

...

 

If there are more fields than can be displayed in a component you can:

  • Either add scroll bars to the component. In Style Settings, select Show Horizontal Scroll Bar or Show Vertical Scroll Bar.
  • Or

...

  • allow the parent component to expand by unticking Auto Size in the parent. This allows the child objects to push the container to expand to fit the content.

...

  1. Create CSS Properties for CSS Tag: min-height and min-width and a value with a specified number of pixels, for example 600px or 300px
  2. Enable scrollbars.
    In the video the scrollbars for the dashboard automatically appeared with the components were allowed to expand beyond the visible screen because a shared style had Allow Vertical Scroll Bars ticked. 

In the body switch off autosize

In each tile, add a CSS property and set CSS Tag: min-height

Tip

Remember, auto size does not mean what you think it means. A component with Auto Size set expands to fill the available space on the screen. 

If you want a component to expand to accommodate all its content, then untick Auto Size.

...

Multimedia
nameFlexbox.mp4

...

  • You must then add scroll bars to the parent component.

Responsive Applications

Use Positions and Sizes to make your application respond to its content and /or the screen size it is being viewed on. When you combine Auto Size with Style Settings, you can achieve a responsive "flexbox" design very easily.

This is shown in this video:

Iframe
srchttps://www.youtube.com/embed/WF2_UxWZ6Rg?rel=0
width650px
height400px

When you set Auto Size and a Direction, PhixFlow provides additional Style Settings for Wrap, Justify and Align. The Align: Stretch option is useful to expand components into the available space perpendicular to the flow direction. For example, in a row, components stretch to fill the vertical space. In a column, they stretch to fill the horizontal space.

More Information