UNPKG

@progress/kendo-react-layout

Version:

React Layout components enable you to create a perceptive and intuitive layout of web projects. KendoReact Layout package

160 lines (159 loc) 5.41 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { BaseEvent } from '@progress/kendo-react-common'; import { TileLayoutHandle } from '../TileLayout.js'; /** * The interface for describing items that can be passed to the `items` prop of the TileLayout component. */ export interface TileLayoutItem { /** * The TileLayoutItem position which is used when the TileLayout is in uncontrolled mode * ([see example](https://www.telerik.com/kendo-react-ui/components/layout/tilelayout/tiles#toc-position-and-dimensions)). */ defaultPosition?: TilePosition; /** * Sets additional CSS styles to the TileLayoutItem. */ style?: React.CSSProperties; /** * Sets additional classes to the TileLayoutItem. */ className?: string; /** * Sets additional CSS styles to the TileLayoutItem hint element. */ hintStyle?: React.CSSProperties; /** * Sets additional classes to the TileLayoutItem hint element. */ hintClassName?: string; /** * Sets the TileLayoutItem title in the header * ([see example](https://www.telerik.com/kendo-react-ui/components/layout/tilelayout/tiles)). */ header?: React.ReactNode; /** * Sets the TileLayoutItem content in the body * ([see example](https://www.telerik.com/kendo-react-ui/components/layout/tilelayout/tiles)). */ body?: React.ReactNode; /** * Overrides the default rendering of the TileLayoutItem * ([see example](https://www.telerik.com/kendo-react-ui/components/layout/tilelayout/tiles#toc-custom-rendering)). */ item?: React.ReactNode; /** * Specifies if the user can resize the TileLayoutItem and in which direction * ([see example](https://www.telerik.com/kendo-react-ui/components/layout/tilelayout/tiles#toc-resizing)). * If `resizable` is not specified, the resizing of the TileLayoutItem is enabled for both directions. * * @default true */ resizable?: TileResizeMode; /** * Specifies if the user can reorder the TileLayoutItem by dragging and dropping it * ([see example](https://www.telerik.com/kendo-react-ui/components/layout/tilelayout/tiles#toc-reordering)). * If `reorderable` is not specified, the dragging functionality of the TileLayoutItem is enabled. * * @default true */ reorderable?: boolean; } /** * Specifies the position of each tile. */ export interface TilePosition { /** * Defines the order index of the TileLayoutItem. * If not set, items will receive a sequential order. */ order?: number; /** * Defines on which column-line the TileLayoutItem starts. * It is required in order reordering and resizing functionalities to work as expected as they rely on it. */ col: number; /** * Specifies how many columns the TileLayoutItem spans. * * @default 1 */ colSpan?: number; /** * Defines on which row-line the TileLayoutItem starts. */ row?: number; /** * Specifies how many rows the TileLayoutItem spans. * * @default 1 */ rowSpan?: number; } /** * Specifies the strict position of each tile. * Used in the [TileLayoutRepositionEvent](https://www.telerik.com/kendo-react-ui/components/layout/api/tilelayoutrepositionevent). */ export interface TileStrictPosition extends TilePosition { /** * Defines the order index of the TileLayoutItem. * If not set, items will receive a sequential order. */ order: number; /** * Specifies how many rows the TileLayoutItem spans. * * @default 1 */ rowSpan: number; /** * Specifies how many columns the TileLayoutItem spans. * * @default 1 */ colSpan: number; } /** * Specifies if the user can resize the TileLayoutItem and in which direction * ([see example](https://www.telerik.com/kendo-react-ui/components/layout/tilelayout/tiles#toc-resizing)). * If `resizable` is not specified, the resizing of the TileLayoutItem is enabled for both directions. */ export type TileResizeMode = 'horizontal' | 'vertical' | boolean; /** * Specifies the gaps between the tiles. */ export interface TileLayoutGap { /** * The rows gap between tiles. * * @default 16px */ rows?: number | string; /** * The columns gap between tiles. * * @default 16px */ columns?: number | string; } /** * 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](https://developer.mozilla.org/en-US/docs/Web/CSS/grid-auto-flow) article. * * @default column */ export type TileLayoutAutoFlow = 'column' | 'row' | 'column dense' | 'row dense' | 'unset'; /** * The arguments for the `onReposition` TileLayout event. */ export interface TileLayoutRepositionEvent extends BaseEvent<TileLayoutHandle> { /** * The new positions of the TileLayout tiles. */ value: Array<TileStrictPosition>; }