Base setting of FluentUI (Getting started)

main
Peace 10 months ago
parent 7d25bb11bf
commit 9118eb3cb6
  1. 5
      BlazorFluentUI/BlazorFluentUI.csproj
  2. 8
      BlazorFluentUI/Components/App.razor
  3. 12
      BlazorFluentUI/Components/Layout/MainLayout.razor
  4. 59
      BlazorFluentUI/Components/Pages/Home.razor
  5. 1
      BlazorFluentUI/Components/_Imports.razor
  6. 7
      BlazorFluentUI/wwwroot/bootstrap/bootstrap.min.css
  7. 1
      BlazorFluentUI/wwwroot/bootstrap/bootstrap.min.css.map

@ -7,7 +7,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.*-* " /> <PackageReference Include="Microsoft.FluentUI.AspNetCore.Components" Version="4.9.0" />
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Icons" Version="4.*-* " /> <PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Emoji" Version="4.6.0" />
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Icons" Version="4.9.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

@ -1,19 +1,27 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<FluentDesignTheme StorageName="theme" />
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="/" /> <base href="/" />
<link rel="stylesheet" href="bootstrap/bootstrap.min.css" />
<link rel="stylesheet" href="app.css" /> <link rel="stylesheet" href="app.css" />
<link rel="stylesheet" href="BlazorFluentUI.styles.css" /> <link rel="stylesheet" href="BlazorFluentUI.styles.css" />
<link rel="icon" type="image/x-icon" href="favicon.ico" /> <link rel="icon" type="image/x-icon" href="favicon.ico" />
<link href="_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css" rel="stylesheet" />
<HeadOutlet /> <HeadOutlet />
</head> </head>
<body> <body>
<Routes /> <Routes />
<script src="_content/Microsoft.FluentUI.AspNetCore.Components/js/loading-theme.js" type="text/javascript"></script>
<loading-theme storage-name="theme"></loading-theme>
<script src="_framework/blazor.web.js"></script> <script src="_framework/blazor.web.js"></script>
<script src="_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.lib.module.js" type="module" async></script>
</body> </body>
</html> </html>

@ -1,5 +1,10 @@
@inherits LayoutComponentBase @inherits LayoutComponentBase
<FluentToastProvider />
<FluentDialogProvider />
<FluentTooltipProvider />
<FluentMessageBarProvider />
<FluentLayout> <FluentLayout>
<FluentHeader> <FluentHeader>
BlazorFluentUI BlazorFluentUI
@ -8,14 +13,17 @@
<NavMenu /> <NavMenu />
<FluentBodyContent Class="body-content"> <FluentBodyContent Class="body-content">
<div class="content"> <div class="content">
<FluentMessageBarProvider Section="MESSAGES_TOP" />
@Body @Body
</div> </div>
</FluentBodyContent> </FluentBodyContent>
<FluentDialogProvider />
<FluentToastProvider MaxToastCount="10" />
</FluentStack> </FluentStack>
<FluentFooter> <FluentFooter>
<a href="https://www.fluentui-blazor.net" target="_blank">Documentation and demos</a> <FluentIcon Class="me-1" Value="@(new Icons.Regular.Size16.EmojiLaugh())"/>This site is powered by Blazor and MS Fluent UI
<FluentSpacer /> <FluentSpacer />
<a href="https://learn.microsoft.com/en-us/aspnet/core/blazor" target="_blank">About Blazor</a> ⓒ Peace
</FluentFooter> </FluentFooter>
</FluentLayout> </FluentLayout>

@ -1,7 +1,62 @@
@page "/" @page "/"
@rendermode RenderMode.InteractiveServer
<PageTitle>Home</PageTitle> <PageTitle>Home</PageTitle>
<h1>Hello, world!</h1> <FluentCard>
<h2>Hello Fluent UI!</h2>
<FluentIcon Value="@(new Icons.Regular.Size24.EmojiSmileSlight())" />
<FluentIcon Value="@(Icon.FromImageUrl("/favicon.ico"))" />
<FluentIcon Value="@(new Icons.Regular.Size24.EmojiSmileSlight())" />
<h2 class="mt-5">Change Theme</h2>
<FluentGrid>
<FluentGridItem>
<FluentSelect Label="Theme"
Width="250px"
Items="@(Enum.GetValues<DesignThemeModes>())"
@bind-SelectedOption="@Mode" />
</FluentGridItem>
<FluentGridItem>
<FluentSelect Label="Color"
Items="@(Enum.GetValues<OfficeColor>().Select(i => (OfficeColor?)i))"
Height="200px"
Width="250px"
@bind-SelectedOption="@OfficeColor">
</FluentSelect>
</FluentGridItem>
</FluentGrid>
<FluentStack Style="margin: 30px 0px; padding: 30px; border: 1px solid var(--accent-fill-rest);">
<FluentIcon Value="@(new Icons.Regular.Size24.Airplane())" />
<FluentLabel>Example of content</FluentLabel>
<FluentButton Appearance="Appearance.Outline">Outline</FluentButton>
<FluentButton Appearance="Appearance.Accent">Accent</FluentButton>
</FluentStack>
</FluentCard>
<FluentDesignTheme @bind-Mode="@Mode"
@bind-OfficeColor="@OfficeColor"
OnLoaded="@OnLoaded"
OnLuminanceChanged="@OnLuminanceChanged"
StorageName="theme" />
@code
{
public DesignThemeModes Mode { get; set; }
public OfficeColor? OfficeColor { get; set; }
void OnLoaded(LoadedEventArgs e)
{
// DemoLogger.WriteLine($"Loaded: {(e.Mode == DesignThemeModes.System ? "System" : "")} {(e.IsDark ? "Dark" : "Light")}");
}
Welcome to your new Fluent Blazor app. void OnLuminanceChanged(LuminanceChangedEventArgs e)
{
// DemoLogger.WriteLine($"Changed: {(e.Mode == DesignThemeModes.System ? "System" : "")} {(e.IsDark ? "Dark" : "Light")}");
}
}

@ -9,3 +9,4 @@
@using Microsoft.JSInterop @using Microsoft.JSInterop
@using BlazorFluentUI @using BlazorFluentUI
@using BlazorFluentUI.Components @using BlazorFluentUI.Components

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save