Tile
Overview
Buttons display only a very small amount of text. However, in some cases it can be helpful to include additional contextual information on a button, to help the user understand at a glance what data or functionality lies beyond that button click. To do this, use the Tiles pattern.
Each tile displays a title and an optional icon at the top. The content displays below that.
Tiles come in one of three sizes: large, wide, and small. Large is a large square and small is a small square. Wide is a short, fat rectangle. The large tile is the size of four small tiles rolled together, with their margins taken into account. Wide is the size of two small tiles side-by-side (with margins taken into account). So tiles all fit nicely together in a grid layout, despite the individual sizes of each tile.
You can leave the tile’s appearance at its default value, or you can choose from a highlighted appearance to call attention to the tile. You can also choose from 3 alternate themed appearances to help visually categorize the tiles, or an error appearance to indicate an error state.
Each tile will clip any content that goes outside of the tile’s content area, so you must pick the correct tile size — Large, Wide, or Small — in order to ensure that its content fits.
The Small tile size displays the icon at top, followed by the header, followed by a very small amount of text. The Large and Wide sizes display the icon on the right, with the header and content on the left, and should be used when you want to display more than a tiny amount of data.
Tiles can be laid out in one of two ways:
- Using relative positioning, where tiles float left-to-right, top-to-bottom, filling the available width and spilling to new rows as needed. This is the typical case. At mobile size the tiles drop into a vertically scrolling list, where each tile takes the full screen width.
- Note that there may be gaps on the right side when you combine several tiles of differing size using relative positioning, as tiles of different size flow to new lines. This is to be expected.
- IMPORTANT: If you’re using relative positioning, you must contain the list of floating tiles within a
<div class="clearfix"></div>
block, otherwise the tiles can roll up into the title area.
- Using fixed positioning with the layout grid. This is useful if you have a fixed number of tiles and want more control over their positioning.
Development
Web component development
Component reference
rui-tile
Button that includes a title, contextual info, and an optional icon
Name | Type | Default | Description |
---|---|---|---|
titleText | string | '' | Title displayed at the top of the tile. |
iconType | string | '' | The name of the icon to display in the tile. You can find a list of all enterprise icons here. The use of custom icons is also supported. |
size | string | 'wide' | The relative size of the tile, one of “large”, “wide”, or “small”. The large and small sizes are squares and the wide size is a horizontal rectangle. |
layout | string | 'float' | One of “float” or “fixed”:
|
appearance | string | 'default' | One of:
|
isDisabled | boolean | false | Set this to true if the tile is disabled. |
isBusy | boolean | false | Displays a busy indicator within the tile when set to true. Set this to true if the data within the tile is currently being loaded. |
rui-click | event | Event fired when the user presses the button. |
Implementation
Begin by importing the rui-tile
module into your application.
Nest the tile’s content within the rui-tile
tag. The content is clipped to the tile’s size, so be sure to select a rui-size
value that is appropriate for the tile. Scrolling is not supported within tiles.
To create a large tile like this:
Nancy Davolio
123 Main St
San Diego, CA
92103
619-555-9283
ndavolio@gmail.com
We could use HTML like this:
The content is laid out slightly differently for small tiles, with the icon up top, the header below that, and a tiny amount of text optionally below that.
To create a small tile like this:
We could use HTML like this:
The use of custom icons is also supported. This can be achieved by using the custom-icon
slot. You can find more information on implementing custom icons on the icon component doc.
Angular wrapper development
Wrapper reference
jha-tile
Button that includes a title, contextual info, and an optional icon
Name | Type | Default | Description |
---|---|---|---|
jhaTitle | string | '' | Title displayed at the top of the tile. |
jhaIconType | string | '' | The name of the icon to display in the tile. You can find a list of all enterprise icons here. The use of custom icons is also supported. |
jhaSize | string | 'Wide' | The relative size of the tile, one of “Large”, “Wide”, or “Small”. The large and small sizes are squares and the wide size is a horizontal rectangle. |
jhaLayout | string | 'float' | One of “Float” or “Fixed”. Specify a value of “Float” if you’re displaying a list of tiles that float left-to-right, top-to-bottom. Specify a value of “Fixed” if you’re using the Bootstrap grid for a more fixed layout. |
jhaAppearance | string | 'Default' | One of:
|
jhaIsDisabled | boolean | false | Set this to true if the tile is disabled. |
jhaIsBusy | boolean | false | Displays a busy indicator within the tile when set to true. Set this to true if the data within the tile is currently being loaded. |
jhaRouterLink | string | '' | If the button links to a view within the app, assign to the route for that view to this attribute. |
Implementation
Begin by importing the JhaTileModule
module into your application.
Nest the tile’s content within the rui-tile
tag. The content is clipped to the tile’s size, so be sure to select a rui-size
value that is appropriate for the tile. Scrolling is not supported within tiles.
To create a large tile like this:
Nancy Davolio
123 Main St
San Diego, CA
92103
619-555-9283
ndavolio@gmail.com
We could use HTML like this:
Place the tile’s content within the jha-tile
tags. The content is clipped to the tile’s size, so be sure to select a jhaSize
value that is appropriate for the tile. Scrolling is not supported within tiles.
The content is laid out slightly differently for small tiles, with the icon up top, the header below that, and a tiny amount of text optionally below that.
To create a small tile like this:
We could use HTML like this:
The use of custom icons is also supported. This can be achieved by using the custom-icon
slot. You can find more information on implementing custom icons on the icon component doc.
Asynchronous Tile Layout
If your view conditionally creates different tiles based on responses from separate asynchronous service calls, with tiles only being created when appropriate based on the service call response, this can result in tiles popping into your layout at different times, as each separate service call completes. This can create a situation where the user goes to click a tile, only to have a new tile suddenly display in the spot previously occupied by the first tile, resulting in the wrong tile being clicked.
Here are 3 options for solving this problem:
- Always display all tiles in the layout. If a tile’s presence is optional (depending on the service call result), then disable the tile until its associated service call returns. If the service call response indicates that the tile applies in this case, then enable the tile. Otherwise leave it disabled. This creates a static layout that prevents tiles from moving out from underneath the user’s mouse. The downside to this approach is that the view could potentially include a lot of (disabled) tiles that don’t apply to the current situation.
- Display the jha-function-view’s busy indicator until all services calls for the view return. This allows you to display only the tiles that apply to the current situation and prevents the user can inadvertently interacting with the wrong tile. The downside to this approach is that the user is unable to interact with any tiles until all services calls complete.
- Daisy chain your service calls one after the other, in order to load the screen more synchronously. Call services for tiles at the bottom-right of the screen after calling services for tiles at the top-left of the screen. That way new tiles always pop into place at the end instead of in the middle. The downside to this approach is that it can cause the screen to take longer to load if it requires many service calls.
Component playground
Design
Figma design
Dev Component | Design Component Name |
---|---|
Tile | RUI / Tile Available values for the Size property:
Available values for the Style property:
|
Tiles come in 3 sizes: Large, Wide, and Small.
Tiles also have multiple options for styling: Normal, Highlighted, Alternate 1, Alternate 2, Alternate 3, Disabled, and Error.
Adobe XD design
- Sample App - Tiles - Large
- Sample App - Tiles - Wide
- Sample App - Tiles - Small
Dev Component | Design Component Name |
---|---|
Tile - large - normal | JHA / Tiles / Large / Normal |
Tile - large - highlighted | JHA / Tiles / Large / Highlighted |
Tile - large - alternate 1 | JHA / Tiles / Large / Alternate 1 |
Tile - large - alternate 2 | JHA / Tiles / Large / Alternate 2 |
Tile - large - alternate 3 | JHA / Tiles / Large / Alternate 3 |
Tile - large - disabled | JHA / Tiles/ Large / Disabled |
Tile - large - error | JHA / Tiles/ Large / Error |
Tile - wide - normal | JHA / Tiles / Wide / Normal |
Tile - wide - highlighted | JHA / Tiles/ Wide / Highlighted |
Tile - wide - alternate 1 | JHA / Tiles / Wide / Alternate 1 |
Tile - wide - alternate 2 | JHA / Tiles / Wide / Alternate 2 |
Tile - wide - alternate 3 | JHA / Tiles / Wide / Alternate 3 |
Tile - wide - disabled | JHA / Tiles / Wide / Disabled |
Tile - wide - error | JHA / Tiles / Wide / Error |
Tile - small - normal | JHA / Tiles / Small / Normal |
Tile - small - highlighted | JHA / Tiles / Small / Highlighted |
Tile - small - alternate 1 | JHA / Tiles / Small / Alternate 1 |
Tile - small - alternate 2 | JHA / Tiles / Small / Alternate 2 |
Tile - small - alternate 3 | JHA / Tiles / Small / Alternate 3 |
Tile - small - disabled | JHA / Tiles / Small / Disabled |
Tile - small - error | JHA / Tiles / Small / Error |
Tiles come in 3 sizes: Large, Wide, and Small.
Tiles also have multiple options for styling: Normal, Highlighted, Alternate 1, Alternate 2, Alternate 3, Disabled, and Error.