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
Assembly: Syncfusion.Blazor.dll
public class SfButton : SfBaseComponent
Constructors
Declaration
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 |
|
Triggers once the component rendering is completed.
Declaration
public EventCallback<object> Created { get; set; }
Property Value
Type |
Description |
Microsoft.AspNetCore.Components.EventCallback<System.Object> |
|
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 |
|
Specifies a value that indicates whether the Button is enabled or disabled.
Declaration
public bool Disabled { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Enable or disable rendering Button component in right to left direction.
Declaration
public bool EnableRtl { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
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 |
|
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
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 |
|
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 |
|
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
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type |
Name |
Description |
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder |
__builder |
|
Sets the focus to button element.
Declaration
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
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)
Declaration
protected override Task OnParametersSetAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|