Spright Blazor generally works equivalently to Nimble Blazor, so refer to the Nimble Blazor README.md. Any Spright-specific differences are listed below.
Any project using SprightBlazor components will typically also be using NimbleBlazor components (e.g. NimbleThemeProvider
if nothing else). SprightBlazor is not a superset of NimbleBlazor, but the spright-components
bundle is a superset of the nimble-components
bundle. Follow the directions below to avoid issues:
-
Add references to both the SprightBlazor and NimbleBlazor NuGet packages in your project
-
Include only the Spright all-components bundle in
_Layout.cshtml
(for BlazorServer) orwwwroot/index.html
(for Blazor WebAssembly):<body> ... <!-- Do NOT also include the nimble-components bundle! --> <script src="_content/SprightBlazor/spright-components/all-components-bundle.min.js"></script> </body>
-
Include both
SprightBlazor.HybridWorkaround.js
andNimbleBlazor.HybridWorkaround.js
inwwwroot/index.html
:</body> ... <script src="_framework/blazor.webview.js"></script> <script src="_content/SprightBlazor/spright-components/all-components-bundle.min.js"></script> <!-- This script is a workaround needed for Nimble Blazor to work in Blazor Hybrid. See https://github.com/dotnet/aspnetcore/issues/42349 --> <script src="_content/NimbleBlazor/NimbleBlazor.HybridWorkaround.js"></script> <script src="_content/SprightBlazor/SprightBlazor.HybridWorkaround.js"></script> </body>
Follow the instructions in CONTRIBUTING.md to modify this library.