# RadzenComponentActivator Class

Allows the developer to replace a component with another. Useful to specify default values for component properties.

Namespace: [Radzen](https://blazor.radzen.com/docs/api/Radzen.md)

Assembly: Radzen.Blazor.dll

## Inheritance

- Object
- RadzenComponentActivator

## Implements

- IComponentActivator

## Syntax

```csharp
public class RadzenComponentActivator : IComponentActivator
```

## Examples

```razor
var builder = WebApplication.CreateBuilder(args);
var activator = new RadzenComponentActivator();
// Replace RadzenButton with MyButton
activator.Override<RadzenButton, MyButton>();
// Replace RadzenDataGrid with MyDataGrid
activator.Override(typeof(RadzenDataGrid<>), typeof(MyDataGrid<>));
// Register the activator
builder.Services.AddSingleton<IComponentActivator>(activator);
```

## Constructors

| Constructor | Description |
|-------------|-------------|
| `public RadzenComponentActivator()` | Allows the developer to replace a component with another. Useful to specify default values for component properties. |

## Methods

| Method | Returns | Description |
|------|---------|-------------|
| `CreateInstance(Type componentType)` | `IComponent` | Creates a component of the specified type. |
| `Override()` | `void` | Replaces the specified component type with another. |
| `Override(Type original, Type override)` | `void` | Replaces the specified component type with another. |

