---
title: "Class ViewComponentComponentRenderer"
slug: "sitecore.aspnet.renderingengine.rendering.viewcomponentcomponentrenderer"
abstract: ""
---
# Class ViewComponentComponentRenderer

An [IComponentRenderer](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.icomponentrenderer.html) that will render View Components.

## Inheritance

System.Object

ViewComponentComponentRenderer

### Implements

[IComponentRenderer](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.icomponentrenderer.html)

#### **Namespace**: Sitecore.AspNet.RenderingEngine.Rendering

##### **Assembly**: Sitecore.AspNet.RenderingEngine.dll

##### Syntax

```csharp
public class ViewComponentComponentRenderer : Object, IComponentRenderer

```

### Constructors

#### ViewComponentComponentRenderer(String)

Initializes a new instance of the [ViewComponentComponentRenderer](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.viewcomponentcomponentrenderer.html) class.

##### Declaration

```csharp
public ViewComponentComponentRenderer(string locator)

```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.String | locator | The string to use when locating the View Component. |

### Methods

#### Describe(Predicate<String>, String)

Creates an instance of a [ComponentRendererDescriptor](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.componentrendererdescriptor.html) for the [ViewComponentComponentRenderer](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.viewcomponentcomponentrenderer.html) class.

##### Declaration

```csharp
public static ComponentRendererDescriptor Describe(Predicate<string> match, string locator)

```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| System.Predicate<br><br><<br><br>System.String<br><br>> | match | A predicate to use when attempting to match a layout component. |
| System.String | locator | The string to use when locating the View Component. |

##### Returns

| Type | Description |
| --- | --- |
| ComponentRendererDescriptor | An instance of [ComponentRendererDescriptor](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.componentrendererdescriptor.html). |

#### Render(ISitecoreRenderingContext, ViewContext)

Generates the output HTML.

##### Declaration

```csharp
public Task<IHtmlContent> Render(ISitecoreRenderingContext renderingContext, ViewContext viewContext)

```

##### Parameters

| Type | Name | Description |
| --- | --- | --- |
| ISitecoreRenderingContext | renderingContext | The current [ISitecoreRenderingContext](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.isitecorerenderingcontext.html). |
| Microsoft.AspNetCore.Mvc.Rendering.ViewContext | viewContext | The current Microsoft.AspNetCore.Mvc.Rendering.ViewContext. |

##### Returns

| Type | Description |
| --- | --- |
| System.Threading.Tasks.Task<br><br><<br><br>Microsoft.AspNetCore.Html.IHtmlContent<br><br>> | The HTML content to render. |

### Implements

[IComponentRenderer](https://doc.sitecore.com/xp/en/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.rendering.icomponentrenderer.html)
