|
| 1 | +--- |
| 2 | +title: Overview |
| 3 | +page_title: AppBar Overview |
| 4 | +description: Discover the AppBar component for Blazor. Learn how to add the component to your app and explore its features like sections, dividers, positioning, and various styling options. |
| 5 | +slug: appbar-overview |
| 6 | +tags: telerik,blazor,appbar,navbar |
| 7 | +published: True |
| 8 | +position: 0 |
| 9 | +--- |
| 10 | + |
| 11 | +# Blazor AppBar Overview |
| 12 | + |
| 13 | +The <a href = "https://www.telerik.com/blazor-ui/appbar" target="_blank">Blazor AppBar component</a> helps you build navigation bars for your application seamlessly. This article explains how to start using the component and describes its features. |
| 14 | + |
| 15 | +## Creating Blazor AppBar |
| 16 | + |
| 17 | +1. Add the `<TelerikAppBar>` tag to a Razor file. |
| 18 | +1. Use the `<AppBarSection>` child tag to add content to the AppBar component. |
| 19 | +1. (optional) Use [spacers or separators](#content-dividers) to add visual distinction between the sections in the AppBar. |
| 20 | + |
| 21 | +>caption Basic configuration of the Telerik AppBar |
| 22 | +
|
| 23 | +````CSHTML |
| 24 | +<TelerikAppBar> |
| 25 | + <AppBarSection> |
| 26 | + <span>Company Logo</span> |
| 27 | + </AppBarSection> |
| 28 | +
|
| 29 | + <AppBarSpacer></AppBarSpacer> |
| 30 | +
|
| 31 | + <AppBarSection> |
| 32 | + <span>Our Products</span> |
| 33 | + </AppBarSection> |
| 34 | +
|
| 35 | + <AppBarSeparator></AppBarSeparator> |
| 36 | +
|
| 37 | + <AppBarSection> |
| 38 | + <span>Our Mission</span> |
| 39 | + </AppBarSection> |
| 40 | +
|
| 41 | + <AppBarSeparator></AppBarSeparator> |
| 42 | +
|
| 43 | + <AppBarSection> |
| 44 | + <span>Contact Us</span> |
| 45 | + </AppBarSection> |
| 46 | +
|
| 47 | + <AppBarSpacer></AppBarSpacer> |
| 48 | +
|
| 49 | + <AppBarSection> |
| 50 | + <TelerikSvgIcon Icon="@SvgIcon.User"></TelerikSvgIcon> |
| 51 | + </AppBarSection> |
| 52 | +
|
| 53 | + <AppBarSeparator></AppBarSeparator> |
| 54 | +
|
| 55 | + <AppBarSection> |
| 56 | + <TelerikSvgIcon Icon="@SvgIcon.Logout"></TelerikSvgIcon> |
| 57 | + </AppBarSection> |
| 58 | +</TelerikAppBar> |
| 59 | +```` |
| 60 | + |
| 61 | +## AppBar Sections |
| 62 | + |
| 63 | +Use the AppBar Sections to render arbitrary HTML content to match the UI and UX needs of your application. [Read more about the Blazor AppBar sections...]({%slug appbar-sections%}) |
| 64 | + |
| 65 | +## Content Dividers |
| 66 | + |
| 67 | +The AppBar features separators and spacers that can visually divide the component items. [Read more about the Blazor AppBar separators and spacers.]({%slug appbar-separators%}). |
| 68 | + |
| 69 | +## Positioning |
| 70 | + |
| 71 | +You can control the position of the AppBar and how the component behaves according to the flow of the page. [Read more about the Blazor AppBar positioning.]({%slug appbar-position%}). |
| 72 | + |
| 73 | +## AppBar Parameters |
| 74 | + |
| 75 | +The Blazor AppBar provides parameters to configure the component. Also check the [AppBar API Reference](/blazor-ui/api/Telerik.Blazor.Components.TelerikAppBar) for a full list of properties. |
| 76 | + |
| 77 | +@[template](/_contentTemplates/common/parameters-table-styles.md#table-layout) |
| 78 | + |
| 79 | +| Parameter | Type | Description | |
| 80 | +| ----------- | ----------- | ----------- | |
| 81 | +| `Position` | `AppBarPosition` <br /> (`None`) | The position of the AppBar on the page. [Read more about AppBar positioning.]({%slug appbar-position%}) | |
| 82 | +| `PositionMode` | `AppBarPosition` <br /> (`Static`) | Sets how the AppBar is positioned according to the flow of the document. [Read more about AppBar positioning.]({%slug appbar-position%}) | |
| 83 | + |
| 84 | +### Styling and Appearance |
| 85 | + |
| 86 | +The following parameters enable you to customize the appearance of the Blazor AppBar: |
| 87 | + |
| 88 | +| Parameter | Type | Description | |
| 89 | +| --- | --- | --- | |
| 90 | +| `Class` | `string` | The CSS class to be rendered on the main wrapping element of the AppBar component, which is `<div class="k-appbar">`. Use for [styling customizations]({%slug themes-override%}). | |
| 91 | +| `Height` | `string` | The height of the AppBar. | |
| 92 | +| `ThemeColor` | `Telerik.Blazor.ThemeConstants.AppBar.ThemeColor` | Adjust the color of the AppBar | |
| 93 | +| `Width` | `string` | The width of the AppBar. | |
| 94 | + |
| 95 | +You can find more information for customizing the AppBar appearance in the [Appearance article]({%slug appbar-appearance%}). |
| 96 | + |
| 97 | +## AppBar Reference and Methods |
| 98 | + |
| 99 | +To execute AppBar methods, obtain reference to the component instance with `@ref`. |
| 100 | + |
| 101 | +| Method | Description | |
| 102 | +|---------|-------------| |
| 103 | +| `Refresh` | Use the method to programmatically re-render the AppBar. | |
| 104 | + |
| 105 | +<div class="skip-repl"></div> |
| 106 | + |
| 107 | +````CSHTML |
| 108 | +<TelerikButton OnClick="@RefreshAppBar">Refresh AppBar</TelerikButton> |
| 109 | +
|
| 110 | +<TelerikAppBar @ref="AppBarRef" /> |
| 111 | +
|
| 112 | +@code { |
| 113 | + private TelerikAppBar AppBarRef { get; set; } |
| 114 | +
|
| 115 | + private void RefreshAppBar() |
| 116 | + { |
| 117 | + AppBarRef.Refresh(); |
| 118 | + } |
| 119 | +} |
| 120 | +```` |
| 121 | + |
| 122 | +## Next Steps |
| 123 | + |
| 124 | +* [Explore the AppBar Sections]({%slug appbar-sections%}) |
| 125 | +* [Use the AppBar Sections]({%slug appbar-separators%}) |
| 126 | +* [Customize the AppBar position]({%slug appbar-position%}) |
| 127 | + |
| 128 | +## See Also |
| 129 | + |
| 130 | +* [Live AppBar Demos](https://demos.telerik.com/blazor-ui/appbar/overview) |
| 131 | +* [AppBar API Reference](/blazor-ui/api/Telerik.Blazor.Components.TelerikAppBar) |
0 commit comments