HtmlForgeX

API Reference

Class

TablerButton

Namespace HtmlForgeX
Assembly HtmlForgeX
Base Element

Tabler button component with full customization options

Inheritance

Constructors

TablerButton 4 overloads
public TablerButton(String text) #

Initializes a new instance of the TablerButton class with text

Parameters

text System.String requiredposition: 0
The button text
public TablerButton(String text, TablerButtonVariant variant) #

Initializes a new instance of the TablerButton class as a link button

Parameters

text System.String requiredposition: 0
The button text
href System.String requiredposition: 1
The URL to navigate to
TablerButton(System.String text, HtmlForgeX.TablerButtonVariant variant) #

Initializes a new instance of the TablerButton class with text and variant

Parameters

text System.String required
The button text
variant HtmlForgeX.TablerButtonVariant required
The button variant
public TablerButton(String text, String href, TablerButtonVariant variant) #

Initializes a new instance of the TablerButton class as a link button with variant

Parameters

text System.String requiredposition: 0
The button text
href System.String requiredposition: 1
The URL to navigate to
variant HtmlForgeX.TablerButtonVariant requiredposition: 2
The button variant

Methods

public TablerButton Attribute(String name, String value) #
Returns: TablerButton
EditorBrowsable(2)

Adds an arbitrary attribute to the underlying element. Intended for advanced scenarios (e.g. Bootstrap data attributes).

Parameters

name System.String requiredposition: 0
value System.String requiredposition: 1
public TablerButton Block(Boolean block = true) #
Returns: TablerButton

Make button full width

Parameters

block System.Boolean = true optionalposition: 0
public TablerButton Class(String classNames) #
Returns: TablerButton

Adds one or more CSS classes to the rendered button element.

Parameters

classNames System.String requiredposition: 0
public static TablerButton Create(String text, Action<TablerButton> configure) #
Returns: TablerButton

Create button with fluent configuration

Parameters

text System.String requiredposition: 0
configure System.Action{HtmlForgeX.TablerButton} requiredposition: 1
public TablerButton Disabled(Boolean disabled = true) #
Returns: TablerButton

Set disabled state

Parameters

disabled System.Boolean = true optionalposition: 0
public TablerButton FormAction(String url) #
Returns: TablerButton

Override form action when this button submits a form.

Parameters

url System.String requiredposition: 0
public TablerButton FormMethod(String method) #
Returns: TablerButton

Override form method when this button submits a form (e.g., POST).

Parameters

method System.String requiredposition: 0
public TablerButton FullWidth(Boolean fullWidth = true) #
Returns: TablerButton
EditorBrowsable(2) Obsolete("Use Block(...) instead.", false)

Make button full width (alias for Block)

Parameters

fullWidth System.Boolean = true optionalposition: 0
public TablerButton Ghost(Boolean ghost = true) #
Returns: TablerButton

Make button ghost (outline only)

Parameters

ghost System.Boolean = true optionalposition: 0
public TablerButton IconOnly(Boolean iconOnly = true) #
Returns: TablerButton

Make button icon-only

Parameters

iconOnly System.Boolean = true optionalposition: 0
public TablerButton Loading(Boolean loading = true) #
Returns: TablerButton

Set loading state

Parameters

loading System.Boolean = true optionalposition: 0
public TablerButton OnClick(String javascript) #
Returns: TablerButton

Set onClick JavaScript

Parameters

javascript System.String requiredposition: 0
public TablerButton Outline(Boolean outline = true) #
Returns: TablerButton

Use outline variant (btn-outline-*) instead of solid (btn-*).

Parameters

outline System.Boolean = true optionalposition: 0
RegisterLibraries() #

Registers the required libraries for this component

public TablerButton Reset() #
Returns: TablerButton

Make button reset type

public TablerButton Size(TablerButtonSize size) #
Returns: TablerButton

Set button size

Parameters

size HtmlForgeX.TablerButtonSize requiredposition: 0
public TablerButton Submit() #
Returns: TablerButton

Make button submit type

public TablerButton Tooltip(String text) #
Returns: TablerButton

Set tooltip

Parameters

text System.String requiredposition: 0
public override String ToString() #
Returns: String

Renders the button to HTML string

Returns

HTML representation of the button

public TablerButton Type(String type) #
Returns: TablerButton

Set button type attribute

Parameters

type System.String requiredposition: 0
public TablerButton Variant(TablerButtonVariant variant) #
Returns: TablerButton

Set button variant (color scheme)

Parameters

variant HtmlForgeX.TablerButtonVariant requiredposition: 0

Properties

public TablerButtonVariant CurrentVariant { get; } #

Gets the current button variant

Extension Methods

public static TablerButton PanelAction(TablerButton button, HfxPanelAction action) #
Returns: TablerButton

Tags a button with a panel shell action (panels toggle / refresh).

Parameters

button HtmlForgeX.TablerButton requiredposition: 0
action HtmlForgeX.HfxPanelAction requiredposition: 1