Platform: Tile Component Technical Design - SAP/fundamental-ngx GitHub Wiki

Tile/Tile Grid

The definitions of a "Tile" differ between Fiori 3 and Fundamental-Styles. Where Fiori 3 defines a tile as being a container of fixed height and set width sizes, the Fundamental-Styles tile is a container with flexible dimensions.

This design assumes that Fundamental-Styles will eventually adopt the Fiori 3 definition of a Tile.

Example

<fdp-tile-grid> <!-- Tile grid is not part of the Tile component, please see TileGrid spec -->
  <fdp-tile [width]="1" [title]="Tile #1" [subtitle]="The first tile">
    <fdp-tile-body>Tile #1 content.</fdp-tile-body>
    <fdp-tile-footer>Tile #1 footer content.</fdp-tile-footer>
  </fdp-tile>
  <fdp-tile [minWidth]="2" [maxWidth]="4" [title]="Tile #2" [subtitle]="The second tile">
    <fdp-tile-body>
      <fdp-tile-column>Tile #2 left content.</fdp-tile-column>
      <fdp-tile-column>Tile #2 right content.</fdp-tile-column>
    </fdp-tile-body>
    <fdp-tile-footer>
       <fdp-tile-column>Tile #2 left footer content.<fdp-tile-column>
       <fdp-tile-column>Tile #2 right footer content.<fdp-tile-column>
    </fdp-tile-footer>
  </fdp-tile>
</fdp-tile-grid>

Design

The Fiori 3 design documentation outlines several tile types:

  • Launch Tile
  • Slide Tile
  • Feed Tile
  • KPI Tile

Each one of these tiles have different specifications for the layout of the tile interior. However all tiles have the same specifications for the "outer" tile dimensions and behavior within the tile grid. As such, we should design a "BaseTile" component from which all tile types will extend from.

Tile Sizes

Fiori 3 specifications define two sizes of tile: "small" and "large". The size of the tile used is determined by screen size. The Fundamental-Styles CSS library should be able to handle this size switching using media type rules. Consequently, we do not have to handle the size properties at the component level.

Tile Grid

Fiori 3 specifications define the layout of tiles based on a grid system. All tiles have a fixed height of two grid units. Tiles are allowed to grow in width by grid unit - The smallest width being two grid units and the largest width being five grid units.

Tile component widths can be specified by setting a minimum width, maximum width or a fixed width.

Tiles within a grid are positioned end-to-end horizontally and will wrap to the next row based on available screen width.


BaseTile

Property Bindings

width: Number

Sets the width of tile to specified number of grid units. Minimum value of "2", maximum value of "5"

minWidth: Number

Sets the minimum width of tile to specified number of grid units. Minimum value of "2", maximum value of "5"

maxWidth: Number

Sets the maximum width of tile to specified number of grid units. Minimum value of "2", maximum value of "5"

Tile Columns

Tile content can be split into two columns using the fdp-tile-column component. The fdp-tile-column component will put the encapsulated content into a container (div) with the proper spacing and padding.


LaunchTile

Example

<fdp-launch-tile
  [width]="2"
  [title]="'Launch Tile'"
  [subtitle]="'Subtitle'"
  (tileClick)="onTileClick()">
  <fdp-tile-body>Body content.</fdp-tile-body>
  <fdp-tile-footer>footer content</fdp-tile-footer>
</fdp-launch-tile>

Property Bindings

Has same properties as BaseTile with the following additional properties.

title: String

Title of the tile.

subtitle: String

Subtitle of the tile.

Event Binding

tileClick

Event emitted when tile is clicked.

Projected Content

fdp-tile-body

Any content within the fdp-tile-body element will be projected into the body of the tile.

fdp-tile-footer

Any content in the fdp-tile-footer element will be projected into the tile footer


SlideTile

Example

<fdp-slide-tile [delay]="2000" [width]="3">
  <fdp-slide-tile-frame
    [title]="Slide #1 Title"
    [subtitle]="Slide #1 Subtitle"
    [footer]="Slide #1 footer content"
    [image]="http://example.com/images/tree.jpg"
    (frameClick)="onFrameOneClick()"></fdp-slide-tile-frame>
  <fdp-slide-tile-frame
    [title]="Slide #2 Title"
    [subtitle]="Slide #2 Subtitle"
    [footer]="Slide #2 footer content"
    [image]="http://example.com/images/ocean.jpg"
    (frameClick)="onFrameTwoClick()"></fdp-slide-tile-frame>
  <fdp-slide-tile-frame
    [title]="Slide #3 Title"
    [subtitle]="Slide #3 Subtitle"
    [footer]="Slide #3 footer content"
    [image]="http://example.com/images/mountain.jpg"
    (frameClick)="onFrameThreeClick()"></fdp-slide-tile-frame>
</fdp-slide-tile>

Property Binding

Has same properties as BaseTile with the following additional properties.

delay: number

Number of millisecond delay between next frame.


SlideTileFrame

Example

See SlideTile example above.

Property Bindings

title: string

Title displayed in slide tile frame.

subtitle: string

Subtitle displayed in slide tile frame.

footer: string

Footer text displayed in slide tile frame.

image: string

URL of image to display in background.

Event Bindings

frameClick

Event emitted on click of frame.


FeedTile

Example

<fdp-feed-tile
  [width]="4"
  [title]="Feed Title"
  [subtitle]="Subtitle"
  [counter]="21"
  (tileClick)="onTileClick()">
  <fdp-tile-body>Body content.</fdp-tile-body>
  <fdp-tile-footer>footer content</fdp-tile-footer>
</fdp-feed-tile>

Property Bindings

Has same properties as BaseTile with the following additional properties.

title: string

Title of the tile.

subtitle: string

Subtitle of the tile.

counter: number

Counter which is displayed in the tile.

Event Binding

tileClick

Event emitted when tile is clicked.

Projected Content

fdp-tile-body

Any content within the fdp-tile-body element will be projected into the body of the tile.

fdp-tile-footer

Any content in the fdp-tile-footer element will be projected into the tile footer.


KPITile

Example

<fdp-kpi-tile>
  [width]="2"
  [title]="'KPI Tile'"
  [subtitle]="'Subtitle'"
  [kpi]="144"
  [trend]="up|down|neutral"
  [state]="positive|negative|critical|neutral"
  [unit]="MB"
  (tileClick)="onTileClick()">
  <fdp-tile-footer>footer content</fdp-tile-footer>
</fdp-kpi-tile>

Property Bindings

Has same properties as BaseTile with the following additional properties.

title: string

Title of the tile.

subtitle: string

Subtitle of the tile.

kpi: number

KPI number to display.

trend: 'up'|'down'|'neutral'

Trend state; can be one of 'up', 'down' or 'neutral'. The state will set the trend icon.

state: 'positive'|'negative'|'critical'|'neutral'

Sets the font color of KPI.

unit: string

The units of the KPI.

icon: string

Icon class name to display to the side of KPI. (optional).

Event Binding

tileClick

Event emitted when tile is clicked.

Projected Content

fdp-tile-footer

Any content in the fdp-tile-footer element will be projected into the tile footer.



i18n

Link to general support for i18n: Supporting internationalization in ngx/platform

The counter attribute can be supported by using DecimalPipe which can automatically translate numbers depending on the locale.

Special Usecase: No

  • Basic fdp-tile can be supported as:
<fdp-tile [width]="1" i18n-title="@@title" title="Tile #1" i18n-subtitle="@@subtitle" subtitle="The first tile">
    <fdp-tile-body i18n="@@tileBody">Tile #1 content.</fdp-tile-body>
    <fdp-tile-footer i18n="@@tileBody">Tile #1 footer content.</fdp-tile-footer>
</fdp-tile>

Note that title, subtitle, and footer can be marked in the same way as shown above for tile subtypes fdp-slide-tile-frame,fdp-launch-tile, fdp-feed-tile, and fdp-kpi-tile.

  • fdp-tile-column can be supported as:
    <fdp-tile-column i18n="@@tileColumnContent" >Tile #2 left content.</fdp-tile-column>

Redesign Required: No


Notes

⚠️ **GitHub.com Fallback** ⚠️