Blazor learning project. Blatternfly is a Blazor implementation of PatternFly.
- Blazor. Some parts of the form and input base components has been copied over from Blazor source code.
- PatternFly.
- .NET 6.0
Add the following to _Imports.razor
@using Blatternfly
@using Blatternfly.Components
@using Blatternfly.Layouts
Add the following to index.html
<link href="_content/Blatternfly/patternfly.css" rel="stylesheet" />
<link href="_content/Blatternfly/patternfly-addons.css" rel="stylesheet" />
See also the getting started section on the PatternFly website for more details.
To dynamically enable/disable the dark theme use the ThemeProvider
component, to set the dark theme as the default theme add the class pf-theme-dark
to the <html>
tag.
Example of Blatternfly configuration in Program.cs
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.Services.AddScoped(sp => new HttpClient
{
BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)
});
builder.AddBlatternfly();
var webhost = builder.Build();
await webhost.UseBlatternfly();
await webhost.RunAsync();
Configure assembly trimming via XML files as explained here 'Customizing Trimming in .NET 5'.
<linker>
<assembly fullname="Blatternfly">
<type fullname="EventHandlers" preserve="all" />
<type fullname="Blatternfly.Interop.MouseEvent" preserve="all" />
<type fullname="Blatternfly.Interop.KeyboardEvent" preserve="all" />
<type fullname="Blatternfly.Interop.ResizeEvent" preserve="all" />
</assembly>
</linker>
Distributed under the MIT License. See LICENSE
for more information.