HtmlForgeX

API Reference

Class

TablerSwitch

Namespace HtmlForgeX
Assembly HtmlForgeX
Base Element
Implements

Toggle switch element styled with Tabler classes.

Inheritance

Constructors

public TablerSwitch(String name) #

Initializes the switch with the specified name.

Parameters

name System.String requiredposition: 0

Methods

public TablerSwitch Align(VerticalAlign align) #
Returns: TablerSwitch

Set vertical alignment relative to the row line.

Parameters

align HtmlForgeX.VerticalAlign requiredposition: 0
public TablerSwitch AlignBottom() #
Returns: TablerSwitch

Convenience to align to the bottom baseline.

public TablerSwitch AlignCenter() #
Returns: TablerSwitch

Convenience to align vertically to the center.

public TablerSwitch Checked(Boolean checked = true) #
Returns: TablerSwitch

Sets whether the switch is checked by default.

Parameters

checked System.Boolean = true optionalposition: 0
Whether the switch is checked.

Returns

The current TablerSwitch instance.

public TablerSwitch Disabled(Boolean disabled = true) #
Returns: TablerSwitch

Sets whether the switch is disabled.

Parameters

disabled System.Boolean = true optionalposition: 0
Whether the switch is disabled.

Returns

The current TablerSwitch instance.

public TablerSwitch Hint(String text) #
Returns: TablerSwitch

Adds non-error help text below the control.

Parameters

text System.String requiredposition: 0
public TablerSwitch Id(String id) #
Returns: TablerSwitch

Sets the HTML id attribute for the switch input.

Parameters

id System.String requiredposition: 0
public TablerSwitch Label(String text) #
Returns: TablerSwitch

Sets the label text displayed next to the switch.

Parameters

text System.String requiredposition: 0
The label text.

Returns

The current TablerSwitch instance.

public TablerSwitch Required(Boolean required = true) #
Returns: TablerSwitch

Marks the switch as required.

Parameters

required System.Boolean = true optionalposition: 0
public TablerSwitch Size(SwitchSize size) #
Returns: TablerSwitch

Sets the size of the switch.

Parameters

size HtmlForgeX.SwitchSize requiredposition: 0
The switch size.

Returns

The current TablerSwitch instance.

public TablerSwitch Stacked(Boolean stacked = true) #
Returns: TablerSwitch

Render with the label above the control (stacked), aligning with text inputs in grids.

Parameters

stacked System.Boolean = true optionalposition: 0
public override String ToString() #
Returns: String

Generates the HTML markup for the switch element.

public TablerSwitch Validation(ValidationState state, String message) #
Returns: TablerSwitch

Sets validation state and message for the switch.

Parameters

state HtmlForgeX.ValidationState requiredposition: 0
message System.String requiredposition: 1