# replaceGridComponent

Replaces a registered custom component definition.

Canonical: https://grid.syidax.com/docs/methods/replaceGridComponent/

<a id="meaning"></a>

## What does this API do?

Replaces a registered custom component definition.

<a id="contract"></a>

## Exact input and result types

```typescript
replaceGridComponent<TKind extends GridComponentKind>(scope: GridComponentRegistrationScope, kind: TKind, name: string, definition: GridComponentDefinitionFor<
      TKind,
      GridData,
      unknown,
      unknown,
      unknown
    >): Promise<void>
```

| Arguments | Required | Type |
| --- | --- | --- |
| scope | Required | GridComponentRegistrationScope |
| kind | Required | TKind |
| name | Required | string |
| definition | Required | GridComponentDefinitionFor<<br>      TKind,<br>      GridData,<br>      unknown,<br>      unknown,<br>      unknown<br>    > |

The return type is `Promise<void>`.

<a id="usage"></a>

## Usage flow

After registering and initializing the Grid element, call grid.replaceGridComponent(…). Read the return value with await. For methods returning a boolean or report, inspect the result before continuing.

<a id="types"></a>

## Read related types

- [GridComponentKind](https://grid.syidax.com/docs/types/GridComponentKind.md)
- [GridComponentRegistrationScope](https://grid.syidax.com/docs/types/GridComponentRegistrationScope.md)
- [GridComponentDefinitionFor](https://grid.syidax.com/docs/types/GridComponentDefinitionFor.md)
- [GridData](https://grid.syidax.com/docs/types/GridData.md)

<a id="recipes"></a>

## Feature explanations and examples

- [Customize cell appearance](https://grid.syidax.com/docs/features/custom-cells.md) — Cell renderers change how data is displayed. Use them for status badges, links, and action buttons while retaining the original values for sorting and filtering.
