Skip to main content

Tile

Tiles are container components. Use them to group similar components or to wrap components which the user may reorder or resize.

tip

To learn more about how to use Tiles refer to the Tile pattern documentation.

Example

Live Editor
Result
Loading...

Usage Rules

Don’t:

  • Nest tiles

Variants

Actions

Tile Actions provide controls in the context of the Tile's content. They may contain input components such as an IconButton or Input. Actions may have a size of $spacing-4 (32px).

To learn more about how to use Tile actions refer to the Tile pattern documentation.

Live Editor
Result
Loading...
Live Editor
Result
Loading...

Clickable

You can add onClick to handle the click event.

Live Editor
Result
Loading...

Contentless

You can use the Tile without content without providing the child element.

Live Editor
Result
Loading...
note

If ESLint's react/jsx-key rule is active make sure to set a key on the individual action components!

Disabled

The Tile can be disabled by adding prop disabled to the component.

Live Editor
Result
Loading...

Draggable

The Tile comes with properties that set styles to indicate whether a Tile is draggable or currently being dragged.

It also supports react-grid-layout for dragging functionality. See an example here.

Live Editor
Result
Loading...

Full Height

You can set the height of Tile to be 100% of container element by adding prop fullHeight.

Live Editor
Result
Loading...

Icon

You can add icons to Tile by passing appId and appName or iconName. Both appId and appName are required to render the appIcon.

Live Editor
Result
Loading...

Icon customization

  • You can custom Icon by using customIcon prop with React Element. Icon can be customised with Icons component or external svg component.
  • Using iconPosition to set icon position such as left or right.
  • Using customIconSize to set the width and height of icon such as 32, 64, ... with 24 (medium icon size) is default size.
Live Editor
Result
Loading...

ShowOverflow

The Tile component's overflow is set to 'hidden' by default but if there is a case you need it to be visible you can use showOverflow prop to achieve it.

Live Editor
Result
Loading...

Resizable

The Tile comes with properties that set styles to indicate whether a Tile is resizable or currently being resized.

It also supports react-grid-layout for resizing functionality. See an example here.

Live Editor
Result
Loading...

Title & Optional Badge & CTA Button

  • title and description are optional props to display the title and description in Tile Header.
  • description also suppoprts rich text tag such as <b>,<i>, <a> and <strong>.
  • titleBadge is an optional prop to show a badge beside the Title.
  • actions prop can provide the CTA button on the right side. Please use only the Atlas Button component with the default Button kind and size.
Live Editor
Result
Loading...

Title & Description

  • title and description are optional props to display the title and description in Tile Header.
  • description also suppoprts rich text tag such as <b>,<i>, <a> and <strong>.
Live Editor
Result
Loading...

You can provide onTitleChange prop to make the title editable.

Live Editor
Result
Loading...

Titles could also be represented with ReactNode.

note

ReactNode passed to <Tile> will be rendered within a component that sets title font styles to ensure consistent text display.

Live Editor
Result
Loading...

You can set titleRequired to true to disallow the use of an empty string as the title value.

Live Editor
Result
Loading...

The Tile also supports a Sidebar by using props:

  • sidebar.content
  • sidebar.isOpen
  • sidebar.onClosed
  • sidebar.closeButtonLabel
Live Editor
Result
Loading...

Examples

Drag-and-drop and resizing Tiles using react-grid-layout

The following example shows how to set up drag-and-drop and resizing of the Tile using react-grid-layout.

Note that additional global styling is required to enable the same UX as you can find in the design specifications. Especially, for the drag and resizing placeholder (see here).

Live Editor
Result
Loading...

Tile with a scrolling Panel inside

Live Editor
Result
Loading...

Tile with Scrollable Table

Live Editor
Result
Loading...

Props

NameTypeDefault
title
The title of the Tile
ReactNode
description
The description of the Tile
string
iconPosition
The icon position (left or right of title)
"left" | "right"
"left"
appId
The appId of app icon that would appear next to the title
string
appName
The appName of app icon that would appear next to the title
string
iconName
Name of the Icon that would appear next to the title. Please refer to the full list of icons here: Link
"AddValue" | "AppGrid" | "ArrowCircleLeft" | "ArrowCircleRight" | "ArrowDown" | "ArrowDownLeft" | "A...
customIcon
The icon that would appear next to the title
ReactElement
customIconSize
The size of custom Icon, eg: 32 (32x32), 64 (64x64)
number
24
titlePlaceholder
Placeholder for the title. Used only for editable title
string
titleRequired
Can be set to true to disallow the use of an empty string as the title value.
boolean
false
titleBadge
A badge content for the title
string
onTitleChange
Callback on the title change. Can be provided to make the title editable
((text: string) => void)
actions
A list of tile actions.
ReactElement[]
[]
padding
This will define padding in the body of the Tile.
"small" | "default" | "none"
showOverflow
This will make the overflow visible
boolean
draggable
This will activate a styling indicating that the tile is draggable
boolean
dragging
This will activate a styling indicating that the tile is currently being dragged. It only works if draggable is set.
boolean
resizable
This will activate a styling indicating that the tile is resizable
boolean
resizing
This will activate a styling indicating that the tile is currently being resized. It only works if resizable is set.
boolean
children
The content of the tile
ReactNode
onClick
onClick function to handle clicks
(() => void)
sidebar
The sidebar displayed within the tile
{ content: ReactNode; isOpen: boolean; onClosed: () => void; closeButtonLabel?: string; }
disabled
Allow to disable tile
boolean
fullHeight
Allow to display tile with 100% height of container
boolean
css
Add custom styles to this component. Use with caution. Learn more here: Link
SupportedStyleAttributes
inputFieldCss
SupportedStyleAttributes
data-{foo}
Data attributes can be used by testing libraries to retrieve components or assert their existence
string
* - the prop is required.