diff --git a/_config.yml b/_config.yml index 0fe3dafada..50e1f6c3d2 100644 --- a/_config.yml +++ b/_config.yml @@ -266,6 +266,8 @@ navigation: title: "Spreadsheet" "*gauges/arc": title: "Arc" + "*appbar": + title: "AppBar" "*autocomplete": title: "AutoComplete" "*avatar": @@ -603,6 +605,7 @@ intro_columns: - title: "Layout" items: + "AppBar": "appbar-overview" "Animation Container": "components/animationcontainer/overview" "Card": "card-overview" "Carousel": "carousel-overview" diff --git a/components/appbar/appearance.md b/components/appbar/appearance.md new file mode 100644 index 0000000000..f1083cdaea --- /dev/null +++ b/components/appbar/appearance.md @@ -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. + +## ThemeColor + +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 + + + + + Our Logo + + + + + + Our Products + + + + + + Our Mission + + + + + + + + + + + + + + + +@code { + private string SelectedColor { get; set; } = "base"; + + private List ThemeColors { get; set; } = new List() + { + "base", + "primary", + "secondary", + "tertiary", + "info", + "success", + "warning", + "error", + "dark", + "light", + "inverse" + }; +} +```` \ No newline at end of file diff --git a/components/appbar/overview.md b/components/appbar/overview.md new file mode 100644 index 0000000000..2ab80ec8d8 --- /dev/null +++ b/components/appbar/overview.md @@ -0,0 +1,131 @@ +--- +title: Overview +page_title: AppBar Overview +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. +slug: appbar-overview +tags: telerik,blazor,appbar,navbar +published: True +position: 0 +--- + +# Blazor AppBar Overview + +The Blazor AppBar component helps you build navigation bars for your application seamlessly. This article explains how to start using the component and describes its features. + +## Creating Blazor AppBar + +1. Add the `` tag to a Razor file. +1. Use the `` 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. + +>caption Basic configuration of the Telerik AppBar + +````CSHTML + + + Company Logo + + + + + + Our Products + + + + + + Our Mission + + + + + + Contact Us + + + + + + + + + + + + + + +```` + +## 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-sections%}) + +## 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. Also check the [AppBar API Reference](/blazor-ui/api/Telerik.Blazor.Components.TelerikAppBar) for a full list of properties. + +@[template](/_contentTemplates/common/parameters-table-styles.md#table-layout) + +| Parameter | Type | Description | +| ----------- | ----------- | ----------- | +| `Position` | `AppBarPosition`
(`None`) | The position of the AppBar on the page. [Read more about AppBar positioning.]({%slug appbar-position%}) | +| `PositionMode` | `AppBarPosition`
(`Static`) | Sets how the AppBar is positioned according to the flow of the document. [Read more about AppBar positioning.]({%slug appbar-position%}) | + +### Styling and Appearance + +The following parameters enable you to customize the appearance of the Blazor AppBar: + +| Parameter | Type | Description | +| --- | --- | --- | +| `Class` | `string` | The CSS class to be rendered on the main wrapping element of the AppBar component, which is `
`. Use for [styling customizations]({%slug themes-override%}). | +| `Height` | `string` | The height of the AppBar. | +| `ThemeColor` | `Telerik.Blazor.ThemeConstants.AppBar.ThemeColor` | Adjust the color of the AppBar | +| `Width` | `string` | The width 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 with `@ref`. + +| Method | Description | +|---------|-------------| +| `Refresh` | Use the method to programmatically re-render the AppBar. | + +
+ +````CSHTML +Refresh AppBar + + + +@code { + private TelerikAppBar AppBarRef { get; set; } + + private void RefreshAppBar() + { + AppBarRef.Refresh(); + } +} +```` + +## Next Steps + +* [Explore the AppBar Sections]({%slug appbar-sections%}) +* [Use the AppBar Sections]({%slug appbar-separators%}) +* [Customize the AppBar position]({%slug appbar-position%}) + +## See Also + +* [Live AppBar Demos](https://demos.telerik.com/blazor-ui/appbar/overview) +* [AppBar API Reference](/blazor-ui/api/Telerik.Blazor.Components.TelerikAppBar) diff --git a/components/appbar/position.md b/components/appbar/position.md new file mode 100644 index 0000000000..450d174809 --- /dev/null +++ b/components/appbar/position.md @@ -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 works. + +## Position + +The `Position` parameter accepts a member of the `AppBarPosition` enum and sets the `top` and `bottom` CSS properties: + +| Enum member | Description | +|---------------|--------| +| `None`
(default) | Does not set any values for the `top` and `bottom` CSS properties. | +| `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 member | Description | +|---------------|--------| +| `Static`
default value | The AppBar displays at the position where it is defined and scrolls together with the other page content. | +| `Fixed` | The AppBar displays at a fixed place, which depends on the `Position` parameter. The component doesn't scroll with the other page content. | +| `Sticky` | The AppBar displays at the position where it is defined. It scrolls together with the other page content, until it reaches the top of the browser viewport. Then the component will remain there. Use the `Sticky` `PositionMode` together with `Top` `Position` .| + +## See Also + + * [Live Demo: AppBar Position](https://demos.telerik.com/blazor-ui/appbar/position) \ No newline at end of file diff --git a/components/appbar/sections.md b/components/appbar/sections.md new file mode 100644 index 0000000000..2003b5e9c1 --- /dev/null +++ b/components/appbar/sections.md @@ -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 `` is a template-based component that allows you to render HTML content or Razor components in the AppBar component. + +>note Render content only inside the `` tag, otherwise it will display outside the AppBar component. + +## AppBar Section Parameters + +The nested `AppBarSection` tag exposes parameters: + +| 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. | +| `Visible` | `bool`
(`true`) | Specifies if the section will be visible in the AppBar. | + +>caption The Telerik AppBar sections with its parameter + +````CSHTML +@* The AppBar sections with its parameters *@ + + + +Toggle the visibility of the Our Mission section + +
+ + + + Our Products + + + + Our Mission + + + +@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%}) diff --git a/components/appbar/separators.md b/components/appbar/separators.md new file mode 100644 index 0000000000..687b3c2907 --- /dev/null +++ b/components/appbar/separators.md @@ -0,0 +1,90 @@ +--- +title: Separators +page_title: AppBar - Separators +description: Separate items in the Telerik AppBar for Blazor +slug: appbar-separators +tags: telerik,blazor,appbar,navbar,separator,spacer +published: True +position: 5 +--- + +# Separators + +You can visually separate the items in the Telerik AppBar for Blazor. Depending on the needs of your application you can use of the following, or a combination of them. + +## AppBar Separator + +To separate two items with a solid line, add the `` tag between them. + +### AppBar Separator Parameters + +The nested `AppBarSeparator` tag exposes the following parameters: + +| Parameter | Type and Default Value | Description | +| ----------- | ----------- | ----------- | +| `Class` | `string` | The CSS class that will be rendered on the main wrapping element of the AppBar separator. Use that class to cascade styles. | +| `Visible` | `bool`
`true` | Specifies if the separator will be visible in the AppBar. | + +## AppBar Spacer + +To separate two items with a solid line, add the `` tag between them. + +Use the `` to define empty space in the AppBar which separates the items. + +### AppBar Spacer Parameters + +The nested `AppBarSpacer` tag exposes the following parameters: + +| Parameter | Type and Default Value | Description | +| ----------- | ----------- | ----------- | +| `Class` | `string` | The CSS class that will be rendered on the main wrapping element of the AppBar spacer. Use that class to cascade styles. | +| `Size` | `string` | The width of the spacer. All `AppBarSpacer` tags without Size will take up the same amount of the remaining space between the [Sections]({%slug appbar-sections%}). | +| `Visible` | `bool`
`true` | Specifies if the spacer will be visible in the AppBar. | + +>caption The AppBar separators + +````CSHTML +@* The AppBar content dividers with some of their parameters and values *@ + + + + + + Our Logo + + + + + + Our Products + + + + + + Our Mission + + + + + + + + + + + + + + +```` + + +## See Also + + * [Live Demo: AppBar Overview](https://demos.telerik.com/blazor-ui/appbar/overview) + * [AppBar Overview]({%slug appbar-overview%})