Localizer
+@inject MessageService MessageService
+@inject ToastService ToastService
@Localizer["H1"]
@@ -9,6 +11,7 @@
@Localizer["P2"]
+ @Localizer["P11"]
@Localizer["P3"]
@Localizer["P4"]
@Localizer["P5"]
@@ -16,9 +19,290 @@
@Localizer["P6"]
-@Localizer["P7"] Motronic @Localizer["P8"] head @Localizer["P9"]:
+@Localizer["P12"] head @Localizer["P14"]:
- <link href="_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css" rel="stylesheet">
+// @Localizer["P23"]
+<link href="_content/BootstrapBlazor/css/bootstrap.blazor.bundle.min.css" rel="stylesheet">
-// @Localizer["P10"]
+// @Localizer["P15"] Fluent UI
+dotnet add package BootstrapBlazor.Theme.Fluent
+<link rel="stylesheet" href="_content/BootstrapBlazor.Theme.Fluent/fluent.min.css">
+
+// @Localizer["P19"] Motronic
<link rel="stylesheet" href="_content/BootstrapBlazor/css/motronic.min.css">
+
+@Localizer["P24"] BootstrapBlazor.Theme.Fluent @Localizer["P25"] _content/BootstrapBlazor.Theme.Fluent/fluent.min.css
+
+@Localizer["P16"] data-bs-theme @Localizer["P17"] <html> @Localizer["P20"] data-bs-theme="dark" @Localizer["P21"] ThemeProvider @Localizer["P22"]
+
+Component preview
+
+Sections below exercise the core components with minimal parameters. Use the theme button at the bottom-right corner of this site to switch between Fluent UI, Motronic and Bootstrap in light or dark mode and eyeball the result in one place.
+
+Buttons
+
+
+
Primary
+
Secondary
+
Success
+
Danger
+
Warning
+
Info
+
Light
+
Dark
+
Link
+
+
+
+
Primary
+
Secondary
+
Success
+
Danger
+
Warning
+
Info
+
Light
+
Dark
+
Link
+
+
+
+
Disabled
+
Disabled outline
+
Icon
+
+
+Forms
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Data display
+
+
+
+
+
Primary
+
Success
+
Danger
+
Warning
+
Primary
+
Success
+
Danger
+
Warning
+
+
+
+
+
+
+
+
+ Featured
+
+
+ Card title
+ With supporting text below as a natural lead-in to additional content.
+
+
+ 2 days ago
+
+
+
+
+
+
+
+Feedback
+
+Primary alert
+Success alert
+Warning alert
+Danger alert
+Info alert with dismiss
+
+
+
Modal
+
+
+ Tooltip
+
+
+
+
Message
+
Toast
+
+
+
+
+
+ Modal body text.
+
+
+
+
+Navigation
+
+
+
+ First tab content
+
+
+ Second tab content
+
+
+ Third tab content
+
+
+
+
+
+
+
+Pickers
+
+
+
+@code {
+ [NotNull]
+ private Modal? Modal { get; set; }
+
+ private List SelectItems { get; } =
+ [
+ new SelectedItem("1", "Option 1"),
+ new SelectedItem("2", "Option 2"),
+ new SelectedItem("3", "Option 3")
+ ];
+
+ private List BreadcrumbItems { get; } =
+ [
+ new BreadcrumbItem("Home", "#"),
+ new BreadcrumbItem("Library", "#"),
+ new BreadcrumbItem("Data")
+ ];
+
+ private List MenuItems { get; } =
+ [
+ new MenuItem("Home", icon: "fa-solid fa-house"),
+ new MenuItem("Components", icon: "fa-solid fa-cubes")
+ {
+ Items = [new MenuItem("Button"), new MenuItem("Table")]
+ },
+ new MenuItem("Settings", icon: "fa-solid fa-gear")
+ ];
+
+ private List TableItems { get; } =
+ [
+ new PreviewItem { Name = "Alice", Count = 3, Date = new DateTime(2026, 1, 5) },
+ new PreviewItem { Name = "Bob", Count = 7, Date = new DateTime(2026, 2, 14) },
+ new PreviewItem { Name = "Carol", Count = 12, Date = new DateTime(2026, 3, 21) }
+ ];
+
+ private void OnShowModal() => Modal.Toggle();
+
+ private async Task OnShowMessage() => await MessageService.Show(new MessageOption { Content = "Message content", Color = Color.Success });
+
+ private async Task OnShowToast() => await ToastService.Success("Toast title", "Toast content");
+
+ private class PreviewItem
+ {
+ public string Name { get; set; } = "";
+
+ public int Count { get; set; }
+
+ public DateTime Date { get; set; }
+ }
+}
diff --git a/src/BootstrapBlazor.Server/Locales/en-US.json b/src/BootstrapBlazor.Server/Locales/en-US.json
index c8f2a443920..74074d1cd3b 100644
--- a/src/BootstrapBlazor.Server/Locales/en-US.json
+++ b/src/BootstrapBlazor.Server/Locales/en-US.json
@@ -550,6 +550,7 @@
},
"BootstrapBlazor.Server.Components.Pages.Install": {
"BootstrapStyle": "// Component styles have been integrated with the latest version of Bootstrap",
+ "FluentDesc": "// The Fluent UI theme is an optional standalone package; install it before adding the stylesheet",
"FontAwesomeCss": "// FontAwesome font icon style Note that you need to reference the BootstrapBlazor.FontAwesome package",
"InstallDesc": "Getting started with BootstrapBlazor for faster and easier .NET web development.",
"InstallTitle": "Install",
@@ -723,17 +724,27 @@
},
"BootstrapBlazor.Server.Components.Pages.Theme": {
"H1": "Component theme",
- "H2": "Test",
+ "H2": "Built-in Themes",
"P1": "The current website theme supports the following",
- "P10": "add this line",
+ "P11": "Fluent UI (integrated)",
+ "P12": "Theme styles are provided as static web assets. In the",
+ "P13": "static web assets",
+ "P14": "section, add the theme stylesheet after the base bundle",
+ "P15": "Enable",
+ "P16": "The built-in themes support both light and dark modes through the",
+ "P17": "attribute on the",
+ "P19": "Optional theme:",
"P2": "Motronic (integrated)",
+ "P20": "element: set",
+ "P21": "for dark mode, or toggle it at runtime with the",
+ "P22": "component, just like the mode button at the bottom-right corner of this site",
+ "P23": "Required base stylesheet",
+ "P24": "The Fluent UI theme is distributed through the standalone NuGet package",
+ "P25": "and its stylesheet is available at",
"P3": "LayUI (in progress)",
"P4": "Bluma (in progress)",
"P5": "Ant Design (in progress)",
- "P6": "Theme switch",
- "P7": "If switch to",
- "P8": "theme, please use the original",
- "P9": "The added style file is as follows"
+ "P6": "Theme switch"
},
"BootstrapBlazor.Server.Components.Samples.Affixs": {
"AffixIntro": "Fix the element to a specific visible area",
diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json
index 43793b996e0..e4f0d57d55f 100644
--- a/src/BootstrapBlazor.Server/Locales/zh-CN.json
+++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json
@@ -550,6 +550,7 @@
},
"BootstrapBlazor.Server.Components.Pages.Install": {
"BootstrapStyle": "// 组件样式已集成 Bootstrap 最新版",
+ "FluentDesc": "// Fluent UI 主题为可选独立包,安装包后添加样式引用",
"FontAwesomeCss": "// FontAwesome 字体图标样式 注意需要引用 BootstrapBlazor.FontAwesome 包",
"InstallDesc": "开始使用 BootstrapBlazor 进行更快、更舒服的 .NET Web 开发",
"InstallTitle": "安装",
@@ -723,17 +724,27 @@
},
"BootstrapBlazor.Server.Components.Pages.Theme": {
"H1": "组件主题",
- "H2": "测试",
+ "H2": "内置主题",
"P1": "目前网站主题支持如下",
- "P10": "增加此行",
+ "P11": "Fluent UI (已集成)",
+ "P12": "主题样式通过静态 Web 资源提供,请在",
+ "P13": "静态 Web 资源",
+ "P14": "内、基础样式之后增加对应的主题样式文件即可",
+ "P15": "启用",
+ "P16": "内置主题通过",
+ "P17": "属性适配明暗两种模式,该属性设置于",
+ "P19": "可选主题:",
"P2": "Motronic (已集成)",
+ "P20": "元素上,设置",
+ "P21": "即为深色模式,也可以在运行时通过",
+ "P22": "组件切换,与本站右下角的模式按钮一致",
+ "P23": "基础样式(必需)",
+ "P24": "Fluent UI 主题由独立 NuGet 包",
+ "P25": "提供,样式资源路径为",
"P3": "LayUI (完善中)",
"P4": "Bluma (完善中)",
"P5": "Ant Design (完善中)",
- "P6": "主题切换",
- "P7": "如切换为",
- "P8": "主题,则请在原有",
- "P9": "内增加样式文件如下"
+ "P6": "主题切换"
},
"BootstrapBlazor.Server.Components.Samples.Affixs": {
"AffixIntro": "将页面元素钉在可视范围",
diff --git a/src/BootstrapBlazor.Server/appsettings.json b/src/BootstrapBlazor.Server/appsettings.json
index fe5a1b5ddaa..4a5a90a3ea3 100644
--- a/src/BootstrapBlazor.Server/appsettings.json
+++ b/src/BootstrapBlazor.Server/appsettings.json
@@ -112,6 +112,14 @@
"files": [
"./css/devui.css"
]
+ },
+ {
+ "key": "fluent",
+ "name": "Fluent UI",
+ "files": [
+ "_content/BootstrapBlazor.Theme.Fluent/fluent.min.css",
+ "./css/fluent.css"
+ ]
}
]
},
diff --git a/src/BootstrapBlazor.Server/wwwroot/css/fluent.css b/src/BootstrapBlazor.Server/wwwroot/css/fluent.css
new file mode 100644
index 00000000000..26fab0a723a
--- /dev/null
+++ b/src/BootstrapBlazor.Server/wwwroot/css/fluent.css
@@ -0,0 +1,23 @@
+/*
+ * Fluent UI 主题演示站配套样式(仅覆盖站点外观变量)
+ * 组件主题本体由 BootstrapBlazor.Theme.Fluent 包分发:_content/BootstrapBlazor.Theme.Fluent/fluent.min.css
+ * 令牌来源:https://github.com/microsoft/fluentui @fluentui/tokens (brandWeb)
+ */
+:root {
+ --bb-sidebar-navbar-bg: #115ea3; /* brand70 */
+ --bb-sidebar-navbar-bar-bg: #0f6cbd; /* brand80 colorBrandBackground */
+ --bb-layout-button-bg: #0f6cbd;
+ --bb-layout-button-hover-bg: #115ea3; /* colorBrandBackgroundHover */
+ --bb-layout-button-active-bg: #0c3b5e; /* colorBrandBackgroundPressed */
+ --bb-layout-button-shadow: 0 0 6px rgba(15,108,189,.5);
+ --bb-layout-button-color: #fff;
+ --bb-layout-button-update-bg: #479ef5; /* brand100 */
+ --bb-button-theme-list-header-color: #fff;
+ --bb-button-theme-item-bg: #f5f5f5;
+ --bb-button-theme-item-color: var(--bs-body-color);
+ --bb-button-theme-item-hover-color: #fff;
+ --bb-button-theme-item-hover-bg: #115ea3;
+ --bb-button-theme-item-active-color: #fff;
+ --bb-button-theme-item-active-bg: #0f6cbd;
+ --bb-button-chat-color: #fff;
+}