# ToggleButtonBuilder

## Properties

### WriteAction - Func

## Methods

### Content(System.Action)

Sets the HTML content of the ToggleButton.

#### Parameters

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

The action which renders the HTML content.

#### RETURNS

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

#### Example

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

### Content(System.Func)

Sets the HTML content of the ToggleButton.

#### Parameters

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

The Razor template for the HTML content.

#### RETURNS

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

#### Example

```
 
             @(Html.Kendo().ToggleButton()
                   .Name("toggleButton")
                   .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 [ToggleButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/togglebuttonbuilder) instance.

#### Example

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

### Tag(System.String)

Sets the ToggleButton 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 [ToggleButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/togglebuttonbuilder) instance.

#### Example

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

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

Defines custom attributes of the ToggleButton's element.

#### Parameters

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

The value for HtmlAttributes

#### RETURNS

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

#### Example

```
 
                @( Html.Kendo().ToggleButton()
                           .Name("Button")
                           .HtmlAttributes(new Dictionary<string, object>() { {"class", "foo"} })
                )
             
```

### HtmlAttributes(System.Object)

Defines custom attributes of the ToggleButton's element.

#### Parameters

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

The value for HtmlAttributes

#### RETURNS

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

#### Example

```
 
                @( Html.Kendo().ToggleButton()
                           .Name("Button")
                           .HtmlAttributes(new {@class = "foo"})
                )
             
```

### Group(System.String)

Specifies a group of ToggleButtons the current instance belongs to. The string will be rendered as a value of the data-group attribute of the widget's element.

#### Parameters

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

The value for Group

#### RETURNS

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

### Selected(System.Boolean)

Specifies the selected state of the ToggleButtons. If set to true the widget will be initially selected.

#### Parameters

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

The value for Selected

#### RETURNS

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

### Selected()

Specifies the selected state of the ToggleButtons. If set to true the widget will be initially selected.

#### RETURNS

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

### Icon(System.String)

Sets the icon of the component.

#### Parameters

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

The value for Icon

#### RETURNS

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

### EndIcon(System.String)

Sets the end icon of the component.

#### Parameters

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

The value for EndIcon

#### RETURNS

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

### IconClass(System.String)

Sets the icon class of the component.

#### Parameters

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

The value for IconClass

#### RETURNS

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

### ImageUrl(System.String)

Sets the image url for the and img element inside the component.

#### Parameters

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

The value for ImageUrl

#### RETURNS

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

### SpriteCssClass(System.String)

Sets the CSS class, which will be used for applying a background image to a span element inside the component.

#### Parameters

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

The value for SpriteCssClass

#### RETURNS

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

### Enable(System.Boolean)

Sets whether the component should be enabled or disabled.

#### Parameters

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

The value for Enable

#### RETURNS

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

### Badge(System.Action)

If set to true a default overlay badge will be displayed. If set to a string, an overlay 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<[ToggleButtonBadgeSettingsBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/togglebuttonbadgesettingsbuilder)>

The configurator for the badge setting.

#### RETURNS

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

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

Sets the size of the component.

#### Parameters

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

The value for Size

#### RETURNS

Returns the current [ToggleButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/togglebuttonbuilder) 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 [ToggleButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/togglebuttonbuilder) instance.

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

Sets a value controlling how the color is applied.

#### Parameters

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

The value for FillMode

#### RETURNS

Returns the current [ToggleButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/togglebuttonbuilder) 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 [ToggleButtonBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/togglebuttonbuilder) instance.

### Events(System.Action)

Configures the client-side events.

#### Parameters

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

The client events action.

#### RETURNS

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

#### Example

```
 
            @(Html.Kendo().ToggleButton()
                  .Name("ToggleButton")
                  .Events(events => events
                      .Toggle("onToggle")
                  )
            )
             
```

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

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