Blazor

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SfButton - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SfButton

    The Button is a graphical user interface element that triggers an event on its click action. It can contain a text, an image, or both.

    Inheritance
    System.Object
    Syncfusion.Blazor.SfBaseComponent
    SfButton
    Namespace: Syncfusion.Blazor.Buttons
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class SfButton : SfBaseComponent

    Constructors

    SfButton()

    Declaration
    public SfButton()

    Properties

    ChildContent

    Sets content for button element including HTML and its customizations.

    Declaration
    public RenderFragment ChildContent { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.RenderFragment

    Content

    Defines the text content of the button element and it will support only string type.

    Declaration
    public string Content { get; set; }
    Property Value
    Type Description
    System.String

    Created

    Triggers once the component rendering is completed.

    Declaration
    public EventCallback<object> Created { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    CssClass

    Defines class/multiple classes separated by a space in the button element. The Button types, styles, and size can be defined by using this property.

    Declaration
    public string CssClass { get; set; }
    Property Value
    Type Description
    System.String

    Disabled

    Specifies a value that indicates whether the Button is enabled or disabled.

    Declaration
    public bool Disabled { get; set; }
    Property Value
    Type Description
    System.Boolean

    EnableRtl

    Enable or disable rendering Button component in right to left direction.

    Declaration
    public bool EnableRtl { get; set; }
    Property Value
    Type Description
    System.Boolean

    IconCss

    Defines class/multiple classes separated by a space for the Button that is used to include an icon. Buttons can also include font icon and sprite image.

    Declaration
    public string IconCss { get; set; }
    Property Value
    Type Description
    System.String

    IconPosition

    Positions the icon based on the text content in the button and its default value is Left. The possible values are:

    • Left: The icon will be positioned to the left of the text content.
    • Right: The icon will be positioned to the right of the text content.
    • Top: The icon will be positioned to the top of the text content.
    • Bottom: The icon will be positioned to the bottom of the text content.
    Declaration
    public IconPosition IconPosition { get; set; }
    Property Value
    Type Description
    IconPosition

    IsPrimary

    Allows the appearance of the button to be enhanced and visually appealing when set to true.

    Declaration
    public bool IsPrimary { get; set; }
    Property Value
    Type Description
    System.Boolean

    IsToggle

    Makes the Button toggle, when set to true. When you click it, the state changes from normal to active or viceversa.

    Declaration
    public bool IsToggle { get; set; }
    Property Value
    Type Description
    System.Boolean

    OnClick

    Triggers when button element is clicked.

    Declaration
    public EventCallback<MouseEventArgs> OnClick { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.Web.MouseEventArgs>

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder

    FocusIn()

    Sets the focus to button element.

    Declaration
    public Task FocusIn()
    Returns
    Type Description
    System.Threading.Tasks.Task

    OnAfterRenderAsync(Boolean)

    Declaration
    protected override Task OnAfterRenderAsync(bool firstRender)
    Parameters
    Type Name Description
    System.Boolean firstRender
    Returns
    Type Description
    System.Threading.Tasks.Task
    Overrides
    Syncfusion.Blazor.SfBaseComponent.OnAfterRenderAsync(System.Boolean)

    OnParametersSetAsync()

    Declaration
    protected override Task OnParametersSetAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task
    Back to top Generated by DocFX
    Copyright © 2001 - 2021 Syncfusion Inc. All Rights Reserved