New to KendoReactStart a free 30-day trial

Represents the props of the TileLayout component.

Definition

Package:@progress/kendo-react-layout

Properties

Controls how the auto-placement algorithm works, specifying exactly how auto-placed items get flowed into the TileLayout. For further reference, check grid-auto-flow CSS article.

Default:

column

(see example).

Example:
jsx
<TileLayout autoFlow="row" />

Sets additional classes to the TileLayout.

Example:
jsx
<TileLayout className="custom-class" />

columns?

number

Specifies the default number of columns (see example).

Example:
jsx
<TileLayout columns={4} />

columnWidth?

string | number

Specifies the default width of the columns (see example).

Example:
jsx
<TileLayout columnWidth={200} />

Represents the key field of the TileLayout item. Used for setting unique keys to the TileLayout items.

Example:
jsx
<TileLayout dataItemKey="id" />

dir?

string

Represents the dir HTML attribute. Use this to switch from LTR to RTL.

Example:
jsx
<TileLayout dir="rtl" />

Specifies the gaps between the tiles (see example).

  • The possible keys are:
  • rows
  • columns
Example:
jsx
<TileLayout gap={{ rows: 10, columns: 10 }} />

id?

string

Sets the id property of the root element.

Example:
jsx
<TileLayout id="tile-layout" />

Use this callback to prevent or allow dragging of the tiles based on specific DOM events. Setting ignoreDrag={(e) => { return !(e.target.classList.contains("k-card-title")); }} makes only the headers draggable. Setting ignoreDrag={(e) => { return e.target.nodeName == "INPUT"; }} ignores dragging input elements.

Parameters:elementHTMLElementReturns:

boolean

Example:
jsx
<TileLayout ignoreDrag={(e) => e.target.nodeName === 'INPUT'} />

The collection of items that will be rendered in the TileLayout (see example).

Example:
jsx
<TileLayout items={[{ header: 'Header', body: 'Body' }]} />

Fires when the user repositions the tile by either dragging or resizing (see example).

Parameters:eventTileLayoutRepositionEvent
Example:
jsx
<TileLayout onReposition={(e) => console.log(e.value)} />

The list of tiles' positions which are used when the TileLayout is in controlled mode (see example).

Example:
jsx
<TileLayout positions={[{ col: 1, row: 1 }]} />

rowHeight?

string | number

Specifies the default height of the rows (see example).

Example:
jsx
<TileLayout rowHeight={100} />

style?

CSSProperties

Sets additional CSS styles to the TileLayout.

Example:
jsx
<TileLayout style={{ backgroundColor: 'lightgray' }} />