# Cells

The KendoReact TreeList provides options for customizing its cell content by allowing you to define different types of cells.

## Supported Cell Types

* [TreeList cells](https://www.telerik.com/kendo-react-ui/components/treelist/cells#treelist-cells)
* [Filter cells](https://www.telerik.com/kendo-react-ui/components/treelist/cells#filter-cells)
* [Edit cells](https://www.telerik.com/kendo-react-ui/components/treelist/cells#edit-cells)
* [Header cells](https://www.telerik.com/kendo-react-ui/components/treelist/cells#header-cells)

### TreeList Cells

The [`TreeListCell`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistcell) component represents a React component that accepts [`TreeListCellProps`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistcellprops) and returns a `<td />` element. The TreeList initializes its cells by using the values from the corresponding data item for each of its rows and columns. You can replace a cell with a custom cell by using the [`cell`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistcolumnprops#cell) property of the column.

### Filter Cells

The [`TreeListTextFilter`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelisttextfilter), [`TreeListNumericFilter`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistnumericfilter), [`TreeListDateFilter`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistdatefilter), and [`TreeListBooleanFilter`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistbooleanfilter) represent React components. The TreeList renders a single filter cell for each column inside the filter row. The filter cells take their values from the value of the [`filter`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistprops#filter) property. You can replace a filter cell with a custom cell by using the [`filterCell`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistcolumnprops#filtercell) property of the column.

### Edit Cells

The [`TreeListTextEditor`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelisttexteditor), [`TreeListNumericEditor`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistnumericeditor), [`TreeListDateEditor`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistdateeditor), and [`TreeListBooleanEditor`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistbooleaneditor) components represent React components that accept [`TreeListCellProps`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistcellprops). The TreeList renders a single edit cell for each column where a data item is in edit mode. Each edit cell triggers the [`TreeListItemChangeEvent`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistitemchangeevent) event and takes its value from the corresponding data item. You can replace an edit cell with a custom cell by using the [`editCell`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistcolumnprops#editcell) property of the column.

### Header Cells

The [`TreeListHeaderCell`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistheadercell) component represents a React component that accepts [`TreeListHeaderCellProps`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistheadercellprops). The TreeList renders a single header cell for the header of each column. Each header cell displays the data [`field`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistcolumnprops#field) or the [`title`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistcolumnprops#title) property together with the sorting indicators. You can replace a header cell with a custom cell by using the [`headerCell`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistcolumnprops#headercell) property of the column.

## Customizing the Cells

To replace a default cell with a custom one, create a React component that accepts [`TreeListCellProps`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistcellprops) and returns a `<td />` element, then pass it to the [`cell`](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistcolumnprops#cell) property of the column.

```tsx
const MyCell = (props: TreeListCellProps) => {
    const cellData = props.dataItem[props.field || ''];
    return (
        <td>
            <span style={{ color: cellData ? 'green' : 'red' }}>{String(cellData)}</span>
        </td>
    );
};

const columns = [
    { field: 'fullTime', title: 'Full Time', cell: MyCell }
];
```

The following example demonstrates how to replace the default **Full Time** column cell with a custom cell that renders the boolean value in green or red.

[Demo Source](https://demos.telerik.com/kendo-react-ui/treelist/cells-custom/func/source.txt)

## Suggested Links

* [API Reference of the TreeList](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistprops)
* [API Reference of the TreeListColumnProps](https://www.telerik.com/kendo-react-ui/components/treelist/api/treelistcolumnprops)
