# ButtonBuilder

## Properties

### WriteAction - Func

## Methods

### Content(System.Action)

Sets the HTML content of the Button.

#### Parameters

##### content - `System.Action`

The action which renders the HTML content.

#### RETURNS

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

#### Example

```
 
             @(  Html.Kendo().Button()
                        .Name("Button1")
                        .Content(() => { >%
                              <p>Content</p>
                         %<})
                        .Render();
            )
             
```

### Content(System.Func)

Sets the HTML content of the Button.

#### Parameters

##### content - `System.Func<Object,Object>`

The Razor template for the HTML content.

#### RETURNS

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

#### Example

```
 
             @(Html.Kendo().Button()
                   .Name("Button1")
                   .Content(@<p>Content</p>)
                   .Render();)
             
```

### Content(System.String)

Sets the HTML content of the Button.

#### Parameters

##### content - `System.String`

The HTML content.

#### RETURNS

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

#### Example

```
 
             @( Html.Kendo().Button()
                     .Name("Button")
                      .Content("<p>Content</p>")
            )
             
```

### Tag(System.String)

Sets the Button HTML tag. A button tag is used by default.

#### Parameters

##### tag - `System.String`

The name of the Html element from which the button is initialized.

#### RETURNS

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

#### Example

```
 
            @( Html.Kendo().Button()
                       .Name("Button")
                       .Tag("a")
            )
             
```

### Badge(System.String)

Sets the value of the badge

#### Parameters

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

The value of the badge.

#### RETURNS

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

#### Example

```
 
            @( Html.Kendo().Button()
                       .Name("Button")
                       .Badge("inactive")
            )
             
```

### Badge(System.Action)

If set to true a default overlay badge will be displayed. If set to a string, an ovelay with content set to the specified string will be displayed. Can be set to a JavaScript object which represents the configuration of the Badge widget.

#### Parameters

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

The configurator for the badge setting.

#### RETURNS

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

### Badge(System.Boolean)

If set to true a default overlay badge will be displayed. If set to a string, an ovelay with content set to the specified string will be displayed. Can be set to a JavaScript object which represents the configuration of the Badge widget.

#### Parameters

##### enabled - `System.Boolean`

Enables or disables the badge option.

#### RETURNS

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

### Enable(System.Boolean)

Indicates whether the Button should be enabled or disabled. By default, it is enabled, unless a disabled="disabled" attribute is detected.

#### Parameters

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

The value for Enable

#### RETURNS

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

### EndIcon(System.String)

Defines a Kendo UI font or SVG icon that is rendered after the Button text.

#### Parameters

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

The value for EndIcon

#### RETURNS

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

### Icon(System.String)

Defines a name of an existing icon in the Kendo UI theme sprite. The icon will be applied as background image of a span element inside the Button. The span element can be added automatically by the widget, or an existing element can be used, if it has a k-icon CSS class applied. For a list of available icon names, please refer to the Icon Button article.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 icon.

#### RETURNS

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

### Icon(System.Action)

Defines a name of an existing icon in the Kendo UI theme sprite. The icon will be applied as background image of a span element inside the Button. The span element can be added automatically by the widget, or an existing element can be used, if it has a k-icon CSS class applied. For a list of available icon names, please refer to the Icon Button article.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<[ButtonIconSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/buttoniconsettingsbuilder)>

The configurator for the icon setting.

#### RETURNS

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

### IconClass(System.String)

Defines a CSS class - or multiple classes separated by spaced - which are applied to a span element inside the Button. Allows the usage of custom icons.

#### Parameters

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

The value for IconClass

#### RETURNS

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

### ImageUrl(System.String)

Defines a URL, which will be used for an img element inside the Button. The URL can be relative or absolute. In case it is relative, it will be evaluated with relation to the web page URL.The img element can be added automatically by the widget, or an existing element can be used, if it has a k-image CSS class applied.

#### Parameters

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

The value for ImageUrl

#### RETURNS

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

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

Controls the overall physical size of a button. Valid values are: "xsmall", "small", "medium", and "large". When undefined (the default), the theme controls the default size.The "none" value is deprecated. Use custom CSS to customize the size.

#### Parameters

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

The value for Size

#### RETURNS

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

### SpriteCssClass(System.String)

Defines a CSS class (or multiple classes separated by spaces), which will be used for applying a background image to a span element inside the Button. In case you want to use an icon from the Kendo UI theme sprite background image, it is easier to use the icon property.The span element can be added automatically by the widget, or an existing element can be used, if it has a k-sprite CSS class applied.

#### Parameters

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

The value for SpriteCssClass

#### RETURNS

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

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

Sets a value controlling the border radius.

#### Parameters

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

The value for Rounded

#### RETURNS

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

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

Sets a value controlling how the color is applied.

#### Parameters

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

The value for FillMode

#### RETURNS

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

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

Sets the color of the component according to the applied theme.

#### Parameters

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

The value for ThemeColor

#### RETURNS

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

### Events(System.Action)

Configures the client-side events.

#### Parameters

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

The client events action.

#### RETURNS

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

#### Example

```
 
            @(Html.Kendo().Button()
                  .Name("Button")
                  .Events(events => events
                      .Click("onClick")
                  )
            )
             
```

### 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.
