# CustomCellType.render Method

> CustomCellType.render method in the TX Sheet Control TypeScript API for Node.js, with the return type string and a TypeScript example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Sheet Control > API Reference > TypeScript API > Node.js Server > CustomCellType > CustomCellType.render Method
- **638 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/customcelltype/render-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/customcelltype/render-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/customcelltype/render-method/llms-full.txt

---

The render operation of CustomCellType.

Owner: [CustomCellType](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/customcelltype/llms-full.txt). Package: `@txtextcontrol/tx-sheet-control-server`. Version: **2.0.0**.

### Syntax

```typescript
render(context: CellRenderContext): string
```

### Parameters

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `context` | `CellRenderContext` | No | Value matching context's declared type and the owning object's validation rules. |

### Return Value

`string`.

### Examples

Use a fresh sample workbook for this example. In the browser pass editor.workbook; in Node.js pass the server control. Document-bound objects are obtained from that same owner.

```typescript
import type { ServerSheetControl } from '@txtextcontrol/tx-sheet-control-server';

function registerInvoiceLabel(control: ServerSheetControl) {
    const book = control.workbook;
    book.cellTypes.register('invoice_label', {
        render: (context) => {
            const text = String(context.value ?? '').replace(
                /[&<>"]/g,
                (character) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[character] ?? character,
            );

            return '<strong>' + text + '</strong>';
        },
    });

    book.sheets.at(0).cell('B10').setCellType({ type: 'custom', renderer: 'invoice_label' });
}
```

### Remarks

Use this member on an object from the current document. Reacquire document-bound handles after replacement/deletion. Validate arguments against the declared types and documented bounds; handle exceptions or rejected promises.

### See Also

- [CustomCellType Interface](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/customcelltype/llms-full.txt)
- [Data Validation](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/validation/llms-full.txt)
- [CellRenderContext Interface](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/cellrendercontext/llms-full.txt)

---

## Nearby

- **Previous:** [CustomCellType.createEditor Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/customcelltype/createeditor-property/llms-full.txt)
- **Next:** [CustomFunctionContext Interface](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/customfunctioncontext/llms-full.txt)
