# BadgeBuilder

## Properties

### WriteAction - Func

## Methods

### Text(System.Single)

The text of the Badge. The valid input includes a string, number, or object with the 'toString()' method. The default value is an empty string.

#### Parameters

##### value - `System.Single`

The value for Text option.

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Badge()
                .Name("badge")
                .Text("100")
            )
             
```

### Encoded(System.Boolean)

Determines whether the textual content should be rendered as an HTML string or it should be encoded.

#### Parameters

##### value - `System.Boolean`

The value for Encoded

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

### CutoutBorder(System.Boolean)

Specifies whether or not to render additional "cutout" border around the badge.

#### Parameters

##### value - `System.Boolean`

The value for CutoutBorder

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Badge()
                   .Name("badge")
                   .CutoutBorder(false)
            )
             
```

### CutoutBorder()

Specifies whether or not to render additional "cutout" border around the badge.

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Badge()
                   .Name("badge")
                   .CutoutBorder(false)
            )
             
```

### Icon(System.String)

Defines the name for an existing icon in a Kendo UI theme or SVG content. The icon is rendered inside the badge by a span.k-icon or span.k-svg-icon element.See web font icons help article for more details on Kendo UI icons.Set this option to an icon descriptor such as { name: "gear", variant: "outline" }. The variant can be outline, solid, or duotone; it applies to SVG rendering and is ignored for font icons.

#### Parameters

##### icon - `System.String`

The value for Icon

#### RETURNS

Returns the current instance of [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) .

#### Example

```
 
            @(Html.Kendo().Badge()
                   .Name("badge")
                   .Icon("user")
            )
             
```

### Icon(System.Action)

Defines the name for an existing icon in a Kendo UI theme or SVG content. The icon is rendered inside the badge by a span.k-icon or span.k-svg-icon element.See web font icons help article for more details on Kendo UI icons.Set this option to an icon descriptor such as { name: "gear", variant: "outline" }. The variant can be outline, solid, or duotone; it applies to SVG rendering and is ignored for font icons.

#### Parameters

##### configurator - System.Action<[BadgeIconSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgeiconsettingsbuilder)>

The configurator for the icon setting.

#### RETURNS

Returns the current instance of [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) .

### Max(System.Double)

If text is a number, it will cap that number.

#### Parameters

##### value - `System.Double`

The value for Max

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Badge()
                   .Name("badge")
                   .Text(100.2f)
                   .Max(99)
            )
             
```

### Template(System.String)

The template which renders the content of the badge.

#### Parameters

##### value - `System.String`

The value for Template

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Badge()
                   .Name("badge")
                   .Template(Html.Kendo().Template().AddHtml("<b>Most Popular</b>"))
            )
             
```

### TemplateId(System.String)

The template which renders the content of the badge.

#### Parameters

##### templateId - `System.String`

The ID of the template element for Template

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Badge()
                   .Name("badge")
                   .Text("15")
                   .TemplateId("sentTemplate")
            )
            <script id="sentTemplate" type="text/x-kendo-template">
                #= this._text # items
            </script>
             
```

### TemplateView(Microsoft.AspNetCore.Html.IHtmlContent)

The template which renders the content of the badge.

#### Parameters

##### templateView - `Microsoft.AspNetCore.Html.IHtmlContent`

The view that contains the template for Template

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Badge()
                   .Name("badge")
                   .Text("100")
                   .TemplateView(Html.Partial("BadgeTemplateView"))
            )
             
```

### TemplateHandler(System.String)

The template which renders the content of the badge.

#### Parameters

##### templateHandler - `System.String`

The handler that returs the template for Template

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Badge()
                   .Name("badge")
                   .Text("100")
                   .TemplateHandler("getBadgeContent")
            )
            <script>
                function getBadgeContent() {
                    if(this._text > 100) {
                        return 'a lot';
                    } else return this._text;
                }
            </script>
             
```

### Template(Kendo.Mvc.UI.Fluent.TemplateBuilder)

The template which renders the content of the badge.

#### Parameters

##### template - TemplateBuilder\<TModel>

A Template component that configures the template.

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

### Text(System.String)

The text of the badge. Valid input includes string, number or object with toString method. Default is empty string.

#### Parameters

##### value - `System.String`

The value for Text

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Badge()
                   .Name("badge")
                   .Text("100")
            )
             
```

### Visible(System.Boolean)

If set to false the badge will not be displayed.

#### Parameters

##### value - `System.Boolean`

The value for Visible

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Badge()
                   .Name("badge")
                   .Text("Most Popular")
                   .Visible(false)
            )
             
```

### Rounded(Kendo.Mvc.UI.Rounded)

Defines the shape of the badge

#### Parameters

##### value - [Rounded](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/rounded)

The value for Rounded

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Badge()
                   .Name("badge")
                   .Text("Most Popular")
                   .Rounded(Rounded.Large)
            )
             
```

### FillMode(Kendo.Mvc.UI.BadgeFill)

Defines how theme colors are applied to a badge

#### Parameters

##### value - [BadgeFill](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/badgefill)

The value for FillMode

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Badge()
                   .Name("badge")
                   .Text("user")
                   .FillMode(BadgeFill.Outline)
            )
             
```

### Size(Kendo.Mvc.UI.BadgeSize)

Defines the size of the badge

#### Parameters

##### value - [BadgeSize](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/badgesize)

The value for Size

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Badge()
                   .Name("badge")
                   .Text("Most Popular")
                   .Size(BadgeSize.Large)
            )
             
```

### Align(Kendo.Mvc.UI.BadgeAlign)

Defines the alignment of the badge

#### Parameters

##### value - [BadgeAlign](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/badgealign)

The value for Align

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Button()
              .Name("save")
              .Content("Save")
              .Badge(b => b
                .Align(BadgeAlign.TopStart)
                .Icon("save")
              )
            )
             
```

### Position(Kendo.Mvc.UI.BadgePosition)

Defines the position of the badge

#### Parameters

##### value - [BadgePosition](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/badgeposition)

The value for Position

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Button()
              .Name("save")
              .Content("Save")
              .Badge(b => b
                .Position(BadgePosition.Edge)
                .Icon("save")
              )
            )
             
```

### ThemeColor(Kendo.Mvc.UI.BadgeColor)

Defines the color of the badge

#### Parameters

##### value - [BadgeColor](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui/badgecolor)

The value for ThemeColor

#### RETURNS

Returns the current [BadgeBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/badgebuilder) instance.

#### Example

```
 
            @(Html.Kendo().Badge()
                   .Name("badge")
                   .Text("user")
                   .ThemeColor(BadgeColor.Primary)
            )
             
```

### ToComponent()

Returns the internal view component.

#### RETURNS

The  instance that represents the component.

### Expression(System.String)

Sets the name of the component.

#### Parameters

##### modelExpression - `System.String`

The name.

#### RETURNS

Returns the current  instance.

### Explorer(Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer)

Sets the name of the component.

#### Parameters

##### modelExplorer - `Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExplorer`

The name.

#### RETURNS

Returns the current  instance.

### Name(System.String)

Sets the name of the component.

#### Parameters

##### componentName - `System.String`

The name.

#### RETURNS

Returns the current  instance.

### Deferred(System.Boolean)

Suppress initialization script rendering. Note that this options should be used in conjunction with Kendo.Mvc.UI.Fluent.WidgetFactory.DeferredScripts(System.Boolean,System.Boolean)

#### Parameters

##### deferred - `System.Boolean`

#### RETURNS

Returns a [DeferredWidgetBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/deferredwidgetbuilder) instance.

### HtmlAttributes(System.Object)

Sets the HTML attributes.

#### Parameters

##### attributes - `System.Object`

The HTML attributes.

#### RETURNS

Returns the current  instance.

### HtmlAttributes(System.Collections.Generic.IDictionary)

Sets the HTML attributes.

#### Parameters

##### attributes - `System.Collections.Generic.IDictionary<String,Object>`

The HTML attributes.

#### RETURNS

Returns the current  instance.

### ScriptAttributes(System.Object,System.Boolean)

Sets the JavaScript attributes to the initialization script.

#### Parameters

##### attributes - `System.Object`

The JavaScript attributes.

##### overrideAttributes - `System.Boolean`

Argument which determines whether attributes should be overriden.

#### RETURNS

Returns the current  instance.

### ScriptAttributes(System.Collections.Generic.IDictionary,System.Boolean)

Sets the JavaScript attributes to the initialization script.

#### Parameters

##### attributes - `System.Collections.Generic.IDictionary<String,Object>`

The JavaScript attributes.

##### overrideAttributes - `System.Boolean`

Argument which determines whether attributes should be overriden.

#### RETURNS

Returns the current  instance.

### Render()

Renders the component in place.

### ToHtmlString()

Returns the HTML representation of the component.

### WriteTo(System.IO.TextWriter,System.Text.Encodings.Web.HtmlEncoder)

#### Parameters

##### writer - `System.IO.TextWriter`

##### encoder - `System.Text.Encodings.Web.HtmlEncoder`

### ToClientTemplate()

Returns the client template for the component.

### AsModule(System.Boolean)

Specifies whether the initialization script of the component will be rendered as a JavaScript module.

#### Parameters

##### value - `System.Boolean`

#### RETURNS

Returns the current  instance.
