Developer Programs

Learn

Docs

Tile

Components > User Interaction > Tile
Use this component to...
Allow the user to trigger an action or navigation while viewing contextual info

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.

Three tiles that use the “Wide” size
$1,203.84 $9,882.91 $15,000.00

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.
Floated tile layout: uses relative positioning
Large tile Large tile Highlighted Wide tile Small tile Alternate 1 Alternate 2 Alternate 3 Error
Fixed tile layout: uses fixed positioning
Tile 1 content here
Tile 2 content here
Tile 3 content here
Tile 4 content here
Tile 5 content here
Tile 6 content here

Development

Web component development

Component reference

rui-tile
rui-tile
Module: rui-tile - Package: @jkhy/responsive-ui-wc

Button that includes a title, contextual info, and an optional icon

NameTypeDefaultDescription
titleTextstring''Title displayed at the top of the tile.
iconTypestring''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.
sizestring'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.
layoutstring'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 responsive layout grid.
appearancestring'default'

One of:

  • “default” uses the default tile styling.
  • “highlighted” uses a highlighted styling, good for calling attention to this tile.
  • “alternate1”, “alternate2”, and “alternate3” use different styling within the theme colors. This can be useful for visually grouping a set of tiles that have a similar purpose.
  • “error” displays styling appropriate for an error state.
isDisabledbooleanfalseSet this to true if the tile is disabled.
isBusybooleanfalseDisplays 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-clickeventEvent fired when the user presses the button.

Implementation

Begin by importing the rui-tile module into your application.

Import the module
// import into app.module
import '@jkhy/responsive-ui-wc/components/rui-tile/rui-tile-imports';

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:

Large tile example
<rui-tile titleText="Customer Info" iconType="information" size="large">
    <p>
        {{customerInfo.name}}<br />
        {{customerInfo.address}}<br />
        {{customerInfo.city}}, {{customerInfo.state}}
        {{customerInfo.zip}}<br />
    </p>
    <p>
        {{customerInfo.homePhone}}<br />
        {{customerInfo.primaryEmail}}<br />
    </p>
</rui-tile>

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:

2

We could use HTML like this:

Small tile example
<rui-tile titleText="Email" iconType="mail" size="small">
    {{emailList.length}}
</rui-tile>

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.

Tile with custom icon example
<rui-tile titleText="Email" size="small">
    <svg slot="custom-icon" fill="currentColor" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg">
        <path d="M0 26.016q0 2.496 1.76 4.224t4.256 1.76 4.224-1.76 1.76-4.224v-2.016h8v2.016q0 2.496 1.792 4.256t4.224 1.728q2.464 0 4.224-1.76t1.76-4.224-1.76-4.256-4.224-1.76h-2.016v-8h2.016q2.464 0 4.224-1.76t1.76-4.224-1.76-4.256-4.224-1.76-4.256 1.76-1.76 4.256q0 0.992 0.384 1.984h-8.736q0.352-1.024 0.352-1.984 0-2.496-1.76-4.256t-4.224-1.76-4.256 1.76-1.76 4.256 1.76 4.224 4.256 1.76h1.984v8h-1.984q-2.528 0-4.256 1.792t-1.76 4.224zM4 26.016q0-0.832 0.576-1.408t1.44-0.608 1.408 0.608 0.576 1.408-0.576 1.408-1.408 0.576-1.44-0.576-0.576-1.408zM4 6.016q0-0.832 0.576-1.408t1.44-0.608 1.408 0.608 0.576 1.408-0.576 1.408-1.408 0.576-1.44-0.576-0.576-1.408zM12 20v-8h8v8h-8zM24 26.016q0-0.832 0.576-1.408t1.44-0.608 1.408 0.608 0.576 1.408-0.576 1.408-1.408 0.576-1.44-0.576-0.576-1.408zM24 6.016q0-0.832 0.576-1.408t1.44-0.608 1.408 0.608 0.576 1.408-0.576 1.408-1.408 0.576-1.44-0.576-0.576-1.408z"></path>
    </svg>
    {{emailList.length}}
</rui-tile>

Angular wrapper development

Wrapper reference

jha-tile
jha-tile
Module: JhaTileModule - Package: @jkhy/responsive-ui-angular

Button that includes a title, contextual info, and an optional icon

NameTypeDefaultDescription
jhaTitlestring''Title displayed at the top of the tile.
jhaIconTypestring''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.
jhaSizestring'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.
jhaLayoutstring'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.
jhaAppearancestring'Default'

One of:

  • “Default” uses the default tile styling.
  • “Highlighted” uses a highlighted styling, good for calling attention to this tile.
  • “Alternate1”, “Alternate2”, and “Alternate3” use different styling within the theme colors. This can be useful for visually grouping a set of tiles that have a similar purpose.
  • “Error” displays styling appropriate for an error state.
jhaIsDisabledbooleanfalseSet this to true if the tile is disabled.
jhaIsBusybooleanfalseDisplays a busy indicator within the tile when set to true. Set this to true if the data within the tile is currently being loaded.
jhaRouterLinkstring''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.

Import the module
// import into app.module
import { JhaTileModule } from '@jkhy/responsive-ui-angular/jha-tile';

@NgModule({
    imports: [
        ...
        JhaTileModule,
        ...
    ]
})

export class AppModule(){}

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:

Large tile example
<jha-tile jhaTitle="Customer Info" jhaIconType="Information" jhaSize="Large">
    <p>
        {{customerInfo.name}}<br />
        {{customerInfo.address}}<br />
        {{customerInfo.city}}, {{customerInfo.state}}
        {{customerInfo.zip}}<br />
    </p>
    <p>
        {{customerInfo.homePhone}}<br />
        {{customerInfo.primaryEmail}}<br />
    </p>
</jha-tile>

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:

2

We could use HTML like this:

Small tile example
<jha-tile jhaTitle="Email" jhaIconType="Mail" jhaSize="Small">
    {{emailList.length}}
</jha-tile>

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.

Tile with custom icon example
<jha-tile jhaTitle="Email" jhaSize="small">
    <svg slot="custom-icon" fill="currentColor" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg">
        <path d="M0 26.016q0 2.496 1.76 4.224t4.256 1.76 4.224-1.76 1.76-4.224v-2.016h8v2.016q0 2.496 1.792 4.256t4.224 1.728q2.464 0 4.224-1.76t1.76-4.224-1.76-4.256-4.224-1.76h-2.016v-8h2.016q2.464 0 4.224-1.76t1.76-4.224-1.76-4.256-4.224-1.76-4.256 1.76-1.76 4.256q0 0.992 0.384 1.984h-8.736q0.352-1.024 0.352-1.984 0-2.496-1.76-4.256t-4.224-1.76-4.256 1.76-1.76 4.256 1.76 4.224 4.256 1.76h1.984v8h-1.984q-2.528 0-4.256 1.792t-1.76 4.224zM4 26.016q0-0.832 0.576-1.408t1.44-0.608 1.408 0.608 0.576 1.408-0.576 1.408-1.408 0.576-1.44-0.576-0.576-1.408zM4 6.016q0-0.832 0.576-1.408t1.44-0.608 1.408 0.608 0.576 1.408-0.576 1.408-1.408 0.576-1.44-0.576-0.576-1.408zM12 20v-8h8v8h-8zM24 26.016q0-0.832 0.576-1.408t1.44-0.608 1.408 0.608 0.576 1.408-0.576 1.408-1.408 0.576-1.44-0.576-0.576-1.408zM24 6.016q0-0.832 0.576-1.408t1.44-0.608 1.408 0.608 0.576 1.408-0.576 1.408-1.408 0.576-1.44-0.576-0.576-1.408z"></path>
    </svg>
    {{emailList.length}}
</jha-tile>

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

Figma design info
You can find this component in the Components - Tiles page in the Figma UI Kit.
Dev ComponentDesign Component Name
Tile

RUI / Tile

Available values for the Size property:

  • Large
  • Small
  • Wide

Available values for the Style property:

  • Normal
  • Highlighted
  • Alternate 1
  • Alternate 2
  • Alternate 3
  • Error
  • Disabled

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

Adobe XD design info
You can find this component in these artboards in the Adobe XD design samples:
  • Sample App - Tiles - Large
  • Sample App - Tiles - Wide
  • Sample App - Tiles - Small
Dev ComponentDesign Component Name
Tile - large - normalJHA / Tiles / Large / Normal
Tile - large - highlightedJHA / Tiles / Large / Highlighted
Tile - large - alternate 1JHA / Tiles / Large / Alternate 1
Tile - large - alternate 2JHA / Tiles / Large / Alternate 2
Tile - large - alternate 3JHA / Tiles / Large / Alternate 3
Tile - large - disabledJHA / Tiles/ Large / Disabled
Tile - large - errorJHA / Tiles/ Large / Error
Tile - wide - normalJHA / Tiles / Wide / Normal
Tile - wide - highlightedJHA / Tiles/ Wide / Highlighted
Tile - wide - alternate 1JHA / Tiles / Wide / Alternate 1
Tile - wide - alternate 2JHA / Tiles / Wide / Alternate 2
Tile - wide - alternate 3JHA / Tiles / Wide / Alternate 3
Tile - wide - disabledJHA / Tiles / Wide / Disabled
Tile - wide - errorJHA / Tiles / Wide / Error
Tile - small - normalJHA / Tiles / Small / Normal
Tile - small - highlightedJHA / Tiles / Small / Highlighted
Tile - small - alternate 1JHA / Tiles / Small / Alternate 1
Tile - small - alternate 2JHA / Tiles / Small / Alternate 2
Tile - small - alternate 3JHA / Tiles / Small / Alternate 3
Tile - small - disabledJHA / Tiles / Small / Disabled
Tile - small - errorJHA / 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.


Support options
Have questions on this topic?
Join the Responsive UI team in Microsoft Teams to connect with the community.
See something in this page that needs to change?
Send us feedback on this page.
Last updated Wed Sep 25 2024