---
product: "AG Grid"
title: "Text Cell Editor"
description: "Simple text editor that uses the standard HTML input . This editor is the default if none other specified."
framework: react
version: "36.2.0"
related:
    - title: "Large Text Editor"
      url: "https://www.ag-grid.com/archive/36.2.0/react-data-grid/provided-cell-editors-large-text/"
    - title: "Number Editor"
      url: "https://www.ag-grid.com/archive/36.2.0/react-data-grid/provided-cell-editors-number/"
    - title: "Date Editors"
      url: "https://www.ag-grid.com/archive/36.2.0/react-data-grid/provided-cell-editors-date/"
    - title: "Checkbox Editor"
      url: "https://www.ag-grid.com/archive/36.2.0/react-data-grid/provided-cell-editors-checkbox/"
    - title: "Select Editor"
      url: "https://www.ag-grid.com/archive/36.2.0/react-data-grid/provided-cell-editors-select/"
    - title: "Rich Select Editor"
      url: "https://www.ag-grid.com/archive/36.2.0/react-data-grid/provided-cell-editors-rich-select/"
llms: "https://www.ag-grid.com/archive/36.2.0/llms.txt"
---

# Text Cell Editor

Simple text editor that uses the standard HTML `input`. This editor is the default if none other specified.

## Enabling Text Cell Editor

Edit any cell in the grid below to see the Text Cell Editor:

#### Text Editor

```tsx
"use client";

import React, {
  useCallback,
  useMemo,
  useRef,
  useState,
  StrictMode,
} from "react";
import { createRoot } from "react-dom/client";
import { AgGridReact, AgGridProvider } from "ag-grid-react";
import {
  ClientSideRowModelModule,
  ColDef,
  ColGroupDef,
  GridApi,
  GridOptions,
  ITextCellEditorParams,
  ModuleRegistry,
  TextEditorModule,
  enableDevValidations,
} from "ag-grid-community";
import { colors } from "./colors";

if (process.env.NODE_ENV !== "production") {
  // Enable extended validations only for development
  enableDevValidations();
}

const modules = [ClientSideRowModelModule, TextEditorModule];

function getRandomNumber(min: number, max: number) {
  // min and max included
  return Math.floor(window.agRandom() * (max - min + 1) + min);
}

const data = Array.from(Array(20).keys()).map(() => {
  const color = colors[getRandomNumber(0, colors.length - 1)];
  return {
    color: color,
    value: getRandomNumber(0, 1000),
  };
});

const GridExample = () => {
  const containerStyle = useMemo(() => ({ width: "100%", height: "100%" }), []);
  const gridStyle = useMemo(() => ({ height: "100%", width: "100%" }), []);
  const [rowData, setRowData] = useState<any[]>(data);
  const [columnDefs, setColumnDefs] = useState<ColDef[]>([
    {
      field: "color",
      cellEditor: "agTextCellEditor",
      cellEditorParams: {
        maxLength: 20,
      } as ITextCellEditorParams,
    },
    {
      field: "value",
      valueFormatter: (params) => `£ ${params.value}`,
      cellEditor: "agTextCellEditor",
      cellEditorParams: {
        maxLength: 20,
      } as ITextCellEditorParams,
    },
  ]);
  const defaultColDef = useMemo<ColDef>(() => {
    return {
      flex: 1,
      editable: true,
    };
  }, []);

  return (
    <AgGridProvider modules={modules}>
      <div style={containerStyle}>
        <div style={gridStyle}>
          <AgGridReact
            rowData={rowData}
            columnDefs={columnDefs}
            defaultColDef={defaultColDef}
          />
        </div>
      </div>
    </AgGridProvider>
  );
};

const root = createRoot(document.getElementById("root")!);
root.render(
  <StrictMode>
    <GridExample />
  </StrictMode>,
);
```

[Live example: Text Editor](https://www.ag-grid.com/archive/36.2.0/examples/provided-cell-editors-text/text-editor/reactFunctionalTs/)

Enabled with `agTextCellEditor` and configured with `ITextCellEditorParams`.

```js
columnDefs: [
    {
        cellEditor: 'agTextCellEditor',
        cellEditorParams: {
            maxLength: 20
        },
    },
]
```

## API Reference

Properties available on the `ITextCellEditorParams&lt;TData = any, TValue = any, TContext = any&gt;` interface.

| Property | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `useFormatter` | `boolean` |  |  |  |
| `maxLength` | `number` |  |  |  |
