alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class SfAppBar

    The AppBar displays the information and actions related to the current application screen. It is used to show branding, screen titles, navigation, and actions.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    SfBaseComponent
    SfAppBar
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnParametersSetAsync()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    SfBaseComponent.Dispose()
    SfBaseComponent.Dispose(bool)
    SfBaseComponent.GetEffectivePlatform()
    SfBaseComponent.GetMainComponentPlatform()
    SfBaseComponent.IsMainLicenseComponent()
    SfBaseComponent.LicenseContext
    SfBaseComponent.OnInitializedAsync()
    SfBaseComponent.OnObservableChange(string, object, bool, NotifyCollectionChangedEventArgs)
    SfBaseComponent.ValidateLicense()
    Namespace: Syncfusion.Blazor.Navigations
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class SfAppBar : SfBaseComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    Remarks

    AppBar component can be populated by specifying the child components within SfAppBar tag directive. Support to inherit colors from AppBar provided to SfButton, SfDropDownButton, SfMenu and SfTextBox. Set CssClass property with

    e-inherit
    CSS class to inherit the background and color from AppBar.
    Examples

    The below example shows AppBar with Primary Button.

    <SfAppBar> 
        <SfButton IsPrimary="true">Primary</SfButton>
    </SfAppBar>

    The below example shows AppBar with Buttons which inherits colors from AppBar.

    <SfAppBar>
    <SfButton CssClass="e-inherit" IconCss="e-icons e-home"></SfButton>
    <AppBarSeparator />
    <SfButton CssClass="e-inherit" IconCss="e-icons e-pan"></SfButton>
    </SfAppBar>

    The below example, AppBarSpacer component used to align the Buttons on left and right.

    <SfAppBar>
    <SfButton CssClass="e-inherit" IconCss="e-icons e-home"></SfButton>
    <AppBarSpacer />
    <SfButton CssClass="e-inherit" IconCss="e-icons e-pan"></SfButton>
    <SfButton CssClass="e-inherit" IconCss="e-icons e-close"></SfButton>
    </SfAppBar>

    Constructors

    SfAppBar()

    Declaration
    public SfAppBar()

    Properties

    ChildContent

    Gets or sets the child content of AppBar component.

    Declaration
    [Parameter]
    public RenderFragment ChildContent { get; set; }
    Property Value
    Type Description
    RenderFragment

    The value used to build the content.

    Examples

    The below example, AppBarSpacer component used to align the Buttons on left and right.

    <SfAppBar>
    <SfButton CssClass="e-inherit" IconCss="e-icons e-home"></SfButton>
    <AppBarSpacer />
    <SfButton CssClass="e-inherit" IconCss="e-icons e-pan"></SfButton>
    <SfButton CssClass="e-inherit" IconCss="e-icons e-close"></SfButton>
    </SfAppBar>

    ColorMode

    Gets or sets the color mode that defines the color of AppBar component.

    Declaration
    [Parameter]
    public AppBarColor ColorMode { get; set; }
    Property Value
    Type Description
    AppBarColor

    One of the AppBarColor enumeration. The default value is Light

    Created

    Triggers when the component is created.

    Declaration
    [Parameter]
    public EventCallback<object> Created { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    Fired when AppBar created.

    CssClass

    Gets or sets the custom classes to customize the AppBar component.

    Declaration
    [Parameter]
    public string CssClass { get; set; }
    Property Value
    Type Description
    string

    If we set the css class, then the custom class is applied for AppBar. The default value is string.Empty.

    Remarks

    Accepts single/multiple classes (separated by a space) to be used for AppBar customization.

    Examples

    In the below example AppBar background and color is customized using CssClass property.

    <SfAppBar CssClass="custom-appbar">
    <SfButton CssClass="e-inherit" IconCss="e-icons e-menu"></SfButton>
    </SfAppBar>
    <style>
    .custom-appbar {
    background: #adadb1;
    color: #fff;
    }
    </style>

    Destroyed

    Triggers when the component is destroyed.

    Declaration
    [Parameter]
    public EventCallback<object> Destroyed { get; set; }
    Property Value
    Type Description
    EventCallback<object>

    Fired when AppBar destroyed.

    IsSticky

    Gets or sets whether the AppBar position is fixed or not while scrolling the page.

    Declaration
    [Parameter]
    public bool IsSticky { get; set; }
    Property Value
    Type Description
    bool

    true, The AppBar will be sticky while scrolling. The default value is false.

    Mode

    Gets or sets mode of the AppBar that defines the AppBar height.

    Declaration
    [Parameter]
    public AppBarMode Mode { get; set; }
    Property Value
    Type Description
    AppBarMode

    One of the AppBarMode enumeration. The default value is Regular

    Position

    Gets or sets position of the AppBar.

    Declaration
    [Parameter]
    public AppBarPosition Position { get; set; }
    Property Value
    Type Description
    AppBarPosition

    One of the AppBarPosition enumeration. The default value is Top

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    RenderTreeBuilder __builder
    Overrides
    ComponentBase.BuildRenderTree(RenderTreeBuilder)

    OnAfterRenderAsync(bool)

    Method invoked after each time the component has been rendered.

    Declaration
    protected override Task OnAfterRenderAsync(bool firstRender)
    Parameters
    Type Name Description
    bool firstRender

    Set to true for the first time component rendering; otherwise gets false.

    Returns
    Type Description
    Task

    A System.Threading.Tasks.Task representing any asynchronous operation.

    Overrides
    SfBaseComponent.OnAfterRenderAsync(bool)

    OnInitialized()

    Declaration
    protected override void OnInitialized()
    Overrides
    ComponentBase.OnInitialized()

    OnParametersSet()

    Declaration
    protected override void OnParametersSet()
    Overrides
    ComponentBase.OnParametersSet()

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved