- Notifications
You must be signed in to change notification settings - Fork 80
AppBar documentation #1749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AppBar documentation #1749
Changes from 8 commits
d44f8dd
3972cf1
a0b7a55
975f14f
428ce1a
3d6b7c0
5674812
b85db7c
6cfa8e4
87ea70a
1d28322
589c32e
2761ea3
469c206
c65e5a9
3a3f772
5ef1a9f
4139dbd
e180546
ae43599
feb61d7
252a840
ceca370
dc9ba4c
3b54fa4
693fbfb
99ff2ff
59b4027
e954cd5
94232d9
4b10b5d
8da108a
012ec13
c3416cd
959a512
771ea7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
--- | ||
title: Appearance | ||
page_title: AppBar Appearance | ||
description: Appearance settings of the AppBar for Blazor. | ||
slug: appbar-appearance | ||
tags: telerik,blazor,appbar,navbar,appearance | ||
published: True | ||
position: 35 | ||
--- | ||
| ||
# Appearance Settings | ||
| ||
This article outlines the available AppBar parameters, which control its appearance. | ||
| ||
## Size | ||
svdimitr marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| ||
You can change the color of the AppBar by setting the `ThemeColor` parameter to a member of the `Telerik.Blazor.ThemeConstants.AppBar.ThemeColor` class: | ||
| ||
| Class members | Manual declarations | | ||
|---------------|--------| | ||
| `Base` | `base` | | ||
| `Primary` | `primary`| | ||
| `Secondary` | `secondary`| | ||
| `Tertiary` | `tertiary`| | ||
| `Info` | `info` | | ||
| `Success` | `success`| | ||
| `Warning` | `warning`| | ||
| `Error` | `error` | | ||
| `Dark` | `dark` | | ||
| `Light` | `light` | | ||
| `Inverse` | `inverse`| | ||
| ||
>caption The built-in AppBar colors | ||
| ||
````CSHTML | ||
<TelerikDropDownList Data="@ThemeColors" @bind-Value="@SelectedColor" Width="150px"></TelerikDropDownList> | ||
| ||
<TelerikAppBar ThemeColor="@SelectedColor"> | ||
<AppBarSection> | ||
<span>Our Logo</span> | ||
</AppBarSection> | ||
| ||
<AppBarSpacer Size="25%"></AppBarSpacer> | ||
| ||
<AppBarSection> | ||
<span>Our Products</span> | ||
</AppBarSection> | ||
| ||
<AppBarSpacer Size="50px"></AppBarSpacer> | ||
| ||
<AppBarSection> | ||
<span>Our Mission</span> | ||
</AppBarSection> | ||
| ||
<AppBarSpacer></AppBarSpacer> | ||
| ||
<AppBarSection> | ||
<TelerikSvgIcon Icon="@SvgIcon.User"></TelerikSvgIcon> | ||
</AppBarSection> | ||
| ||
<AppBarSeparator></AppBarSeparator> | ||
| ||
<AppBarSection> | ||
<TelerikSvgIcon Icon="@SvgIcon.Logout"></TelerikSvgIcon> | ||
</AppBarSection> | ||
</TelerikAppBar> | ||
| ||
@code { | ||
private string SelectedColor { get; set; } = "base"; | ||
| ||
private List<string> ThemeColors { get; set; } = new List<string>() | ||
{ | ||
"base", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better use the static constants, as we want to encourage customers to do the same. | ||
"primary", | ||
"secondary", | ||
"tertiary", | ||
"info", | ||
"success", | ||
"warning", | ||
"error", | ||
"dark", | ||
"light", | ||
"inverse" | ||
}; | ||
} | ||
```` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
--- | ||
title: Overview | ||
page_title: AppBar Overview | ||
description: Overview of the AppBar component for Blazor. | ||
| ||
slug: appbar-overview | ||
tags: telerik,blazor,appbar,navbar | ||
published: True | ||
position: 0 | ||
--- | ||
| ||
# Blazor AppBar Overview | ||
| ||
The <a href = "https://www.telerik.com/blazor-ui/appbar" target="_blank">Blazor AppBar component</a> helps you build navigation bars for your application seemingly. This article explains the available features. | ||
svdimitr marked this conversation as resolved. Outdated Show resolved Hide resolved svdimitr marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| ||
## Creating Blazor AppBar | ||
| ||
1. Add the `<TelerikAppBar>` tag to a Razor file. | ||
1. Use the `<AppBarSection>` child tag to add content to the AppBar component. | ||
1. (optional) Use [spacers or separators](#content-dividers) to add visual distinction between the sections in the AppBar. | ||
1. (optional) Set the [position](#positioning) of the AppBar. | ||
svdimitr marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| ||
>caption Basic configuration of the Telerik AppBar | ||
| ||
````CSHTML | ||
<TelerikAppBar> | ||
<AppBarSection> | ||
<span>Our Logo</span> | ||
svdimitr marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
</AppBarSection> | ||
| ||
<AppBarSpacer Size="25%"></AppBarSpacer> | ||
svdimitr marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| ||
<AppBarSection> | ||
<span>Our Products</span> | ||
</AppBarSection> | ||
| ||
<AppBarSpacer Size="50px"></AppBarSpacer> | ||
| ||
<AppBarSection> | ||
<span>Our Mission</span> | ||
</AppBarSection> | ||
| ||
<AppBarSpacer Size="5vw"></AppBarSpacer> | ||
| ||
<AppBarSection> | ||
<span>Contact Us</span> | ||
</AppBarSection> | ||
| ||
<AppBarSpacer></AppBarSpacer> | ||
| ||
<AppBarSection> | ||
<TelerikSvgIcon Icon="@SvgIcon.User"></TelerikSvgIcon> | ||
</AppBarSection> | ||
| ||
<AppBarSeparator></AppBarSeparator> | ||
| ||
<AppBarSection> | ||
<TelerikSvgIcon Icon="@SvgIcon.Logout"></TelerikSvgIcon> | ||
</AppBarSection> | ||
</TelerikAppBar> | ||
```` | ||
| ||
## AppBar Sections | ||
| ||
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-section%}). | ||
svdimitr marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| ||
## Content Dividers | ||
| ||
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%}). | ||
| ||
## Positioning | ||
| ||
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%}). | ||
| ||
## AppBar Parameters | ||
| ||
The Blazor AppBar provides parameters to configure the component: | ||
svdimitr marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| ||
@[template](/_contentTemplates/common/parameters-table-styles.md#table-layout) | ||
| ||
| Parameter | Type | Description | | ||
| ----------- | ----------- | ----------- | | ||
| `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%}). | | ||
| `Height` | `string` | The height of the AppBar. | | ||
| `Position` | `AppBarPosition` <br /> (`None`) | The position of the AppBar on the page. [Read more about AppBar positioning.]({%slug appbar-position%}) | | ||
| `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%}) | | ||
| `Width` | `string` | The width of the AppBar | | ||
| ||
### Styling and Appearance | ||
svdimitr marked this conversation as resolved. Show resolved Hide resolved | ||
| ||
The following parameters enable you to customize the appearance of the Blazor AppBar: | ||
| ||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| `ThemeColor` | `Telerik.Blazor.ThemeConstants.AppBar.ThemeColor` | Adjust the color of the AppBar | | ||
| ||
You can find more information for customizing the AppBar appearance in the [Appearance article]({%slug appbar-appearance%}). | ||
| ||
## AppBar Reference and Methods | ||
| ||
To execute AppBar methods, obtain reference to the component instance via `@ref`. | ||
svdimitr marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| ||
| Method | Description | | ||
|---------|-------------| | ||
| `Refresh` | Use the method to programmatically re-render the AppBar. | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When will this be necessary? | ||
| ||
<div class="skip-repl"></div> | ||
| ||
````CSHTML | ||
<TelerikButton OnClick="@RefreshAppBar">Refresh AppBar</TelerikButton> | ||
| ||
<TelerikAppBar @ref="AppBarRef" /> | ||
| ||
@code { | ||
private TelerikAppBar AppBarRef { get; set; } | ||
| ||
private void RefreshAppBar() | ||
{ | ||
AppBarRef.Refresh(); | ||
} | ||
} | ||
```` | ||
| ||
## Next Steps | ||
| ||
* [Explore the AppBar Sections]({%slug appbar-sections%}) | ||
* [Use the AppBar Content]({%slug appbar-separators%}) | ||
svdimitr marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
* [Customize the AppBar positioning options]({%slug appbar-position%}) | ||
svdimitr marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| ||
## See Also | ||
| ||
* [Live AppBar Demos](https://demos.telerik.com/blazor-ui/appbar/overview) | ||
* [AppBar API Reference](/blazor-ui/api/Telerik.Blazor.Components.TelerikAppBar) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
title: Position | ||
page_title: AppBar Position | ||
description: Position settings of the AppBar for Blazor. | ||
slug: appbar-position | ||
tags: telerik,blazor,appbar,navbar,position | ||
published: True | ||
position: 35 | ||
--- | ||
| ||
# Position Settings | ||
| ||
This article outlines the available AppBar parameters, which control its position. | ||
| ||
>note Read the [CSS positioning MDN documentation article](https://developer.mozilla.org/en-US/docs/Web/CSS/position) to get a better understanding of how the AppBar component positioning work. | ||
svdimitr marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| ||
## Position | ||
| ||
The `Position` parameter accepts a member of the `AppBarPosition` enum and sets the `top` and `bottom` CSS properties: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not realistic to expect everyone to go read the CSS article, or to understand it. Better explain in simple terms what each position configuration will achieve. You can still leave the CSS details for the CSS nerds. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have, I think, the Position only manipulates the top and bottom CSS properties. The PositionMode manipulates the position CSS property, but I have added some short explanations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My idea is to explain the resulting behavior and not just the technical HTML/CSS output of the component. For example - "the component will display at the top of the viewport and not move during page scrolling". Something like that. | ||
| ||
| Enum members | Description | | ||
svdimitr marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
|---------------|--------| | ||
| `None` <br /> default value | Does not set any values for the `top` and `bottom` CSS properties. | | ||
svdimitr marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| `Top` | Sets the `top: 0` and `bottom: auto` CSS properties. | | ||
| `Bottom` | Sets the `top: auto` and `bottom: 0` CSS properties. | | ||
| ||
>info The `Position` parameter takes effect when used with fixed [PositionMode](#positionmode). | ||
| ||
## PositionMode | ||
| ||
The `PositionMode` parameter accepts a member of the `AppBarPositionMode` enum and sets how the AppBar is positioned according to the [flow of the document](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Normal_Flow): | ||
| ||
| Enum members | Description | | ||
|---------------|--------| | ||
| `Static` <br /> default value | The AppBar is positioned according to the normal flow of the document. | | ||
| `Fixed` | The AppBar is removed from the normal document flow, and no space is created for the element in the page layout. The component is positioned relatively to the viewport of the application. | | ||
| `Sticky` | The AppBar is positioned according to the normal flow of the document, and then offset relative to its nearest scrolling ancestor | | ||
| ||
| ||
## See Also | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add the most logical next step(s) before See Also. It's good for SEO too. | ||
| ||
* [Live Demo: AppBar Position](https://demos.telerik.com/blazor-ui/appbar/position) |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,59 @@ | ||||||
--- | ||||||
title: Sections | ||||||
page_title: AppBar - Sections | ||||||
description: Add Content in the AppBar Component | ||||||
slug: appbar-sections | ||||||
tags: telerik,blazor,appbar,sections,section,content | ||||||
published: True | ||||||
position: 1 | ||||||
--- | ||||||
| ||||||
# Sections | ||||||
| ||||||
The `<AppBarSection>` is a template-based component that allows you to render arbitrary HTML content in the AppBar component. | ||||||
svdimitr marked this conversation as resolved. Outdated Show resolved Hide resolved | ||||||
| ||||||
>note Render content only inside the `<AppBarSection>` tag, otherwise it will render outside the AppBar component. | ||||||
svdimitr marked this conversation as resolved. Outdated Show resolved Hide resolved | ||||||
| ||||||
## AppBar Section Parameters | ||||||
| ||||||
The nested `AppBarSection` tag exposes parameters: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggested change
| ||||||
| ||||||
| Parameter | Type and Default Value | Description | | ||||||
| ----------- | ----------- | ----------- | | ||||||
| `Class` | `string` | The CSS class that will be rendered on the main wrapping element of the AppBar section. You could use that class to cascade styles. | | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggested change
| ||||||
| `Visible` | `bool` <br /> `true` | Specifies if the section will be visible in the AppBar. | | ||||||
svdimitr marked this conversation as resolved. Outdated Show resolved Hide resolved | ||||||
| ||||||
>caption The Telerik AppBar sections with its parameter | ||||||
| ||||||
````CSHTML | ||||||
@* The AppBar sections with its parameters *@ | ||||||
| ||||||
<style> | ||||||
.products-section-class { | ||||||
font-weight: bolder; | ||||||
} | ||||||
</style> | ||||||
| ||||||
<TelerikButton OnClick="@(() => isSectionVisible = !isSectionVisible)">Toggle the visibility of the Our Mission section</TelerikButton> | ||||||
| ||||||
<br /> | ||||||
| ||||||
<TelerikAppBar> | ||||||
<AppBarSection Class="products-section-class"> | ||||||
<span>Our Products</span> | ||||||
</AppBarSection> | ||||||
| ||||||
<AppBarSection Visible="@isSectionVisible"> | ||||||
<span>Our Mission</span> | ||||||
</AppBarSection> | ||||||
</TelerikAppBar> | ||||||
| ||||||
@code{ | ||||||
private bool isSectionVisible { get; set; } = true; | ||||||
} | ||||||
```` | ||||||
| ||||||
## See Also | ||||||
| ||||||
* [Live Demo: AppBar Overview](https://demos.telerik.com/blazor-ui/appbar/overview) | ||||||
* [AppBar Overview]({%slug appbar-overview%}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use detailed descriptions with a length of around 150 symbols. This is more like a placeholder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not, do you have a suggestion for a better description? The feature itself is rather small