|
| 1 | +@attribute [Route(pageUrl)] |
| 2 | +@layout DemosMainLayout |
| 3 | + |
| 4 | +<PageMetaTags PageUrl="@pageUrl" Title="@metaTitle" Description="@metaDescription" ImageUrl="@imageUrl" /> |
| 5 | + |
| 6 | +<PageHero Title="@pageTitle"> |
| 7 | + <SubTitleTemplate> |
| 8 | + @((MarkupString)pageDescription) |
| 9 | + </SubTitleTemplate> |
| 10 | +</PageHero> |
| 11 | + |
| 12 | +<div class="content"> |
| 13 | + <h2>Prerequisites</h2> |
| 14 | + <ul> |
| 15 | + <li>.NET 8 SDK (<a href="https://dotnet.microsoft.com/download/dotnet/8.0" target="_blank">Download</a>)</li> |
| 16 | + <li>Visual Studio 2022 or later / VS Code / JetBrains Rider</li> |
| 17 | + <li>Basic knowledge of Blazor Server or Blazor Web App (Server mode)</li> |
| 18 | + </ul> |
| 19 | + |
| 20 | + <h2>1. Using dotnet Templates</h2> |
| 21 | + <ol> |
| 22 | + <li> |
| 23 | + <b>Install the template:</b> |
| 24 | + <pre><code>dotnet new install BlazorExpress.Bulma.Templates</code></pre> |
| 25 | + </li> |
| 26 | + <li> |
| 27 | + <b>Create a new project:</b> |
| 28 | + <pre><code>dotnet new blazorexpress-bulma -n MyBlazorApp</code></pre> |
| 29 | + </li> |
| 30 | + <li> |
| 31 | + <b>Run your app:</b> |
| 32 | + <pre><code>cd MyBlazorApp |
| 33 | +dotnet run</code></pre> |
| 34 | + </li> |
| 35 | + </ol> |
| 36 | + <p> |
| 37 | + The template sets up Bulma CSS, required services, and sample components. |
| 38 | + </p> |
| 39 | + |
| 40 | + <h2>2. Manual Installation</h2> |
| 41 | + <ol> |
| 42 | + <li> |
| 43 | + <b>Add the NuGet package:</b> |
| 44 | + <pre><code>dotnet add package BlazorExpress.Bulma</code></pre> |
| 45 | + </li> |
| 46 | + <li> |
| 47 | + <b>Add Bulma and BlazorExpress.Bulma CSS to <code>Pages/_Host.cshtml</code> (Blazor Server) or <code>Components/Layouts/MainLayout.razor</code> (Blazor Web App):</b> |
| 48 | + <pre><code><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1.0.0/css/bulma.min.css"> |
| 49 | +<link rel="stylesheet" href="_content/BlazorExpress.Bulma/css/blazorexpress.bulma.css"> |
| 50 | +</code></pre> |
| 51 | + </li> |
| 52 | + <li> |
| 53 | + <b>Add BlazorExpress.Bulma JS to <code>Pages/_Host.cshtml</code> (Blazor Server) or <code>Components/Layouts/MainLayout.razor</code> (Blazor Web App):</b> |
| 54 | + <pre><code><script src="_content/BlazorExpress.Bulma/js/blazorexpress.bulma.js"></script> |
| 55 | +</code></pre> |
| 56 | + </li> |
| 57 | + <li> |
| 58 | + <b>Add <code>@@using BlazorExpress.Bulma</code> to <code>_Imports.razor</code>:</b> |
| 59 | + <pre><code> |
| 60 | +@using BlazorExpress.Bulma |
| 61 | + </code></pre> |
| 62 | + </li> |
| 63 | + <li> |
| 64 | + <b>Register services in <code>Program.cs</code> (if required):</b> |
| 65 | + <pre><code class="language-csharp"> |
| 66 | +// Program.cs |
| 67 | +using BlazorExpress.Bulma; |
| 68 | + |
| 69 | +var builder = WebApplication.CreateBuilder(args); |
| 70 | +// ... your existing setup |
| 71 | + |
| 72 | +// Register BlazorExpress.Bulma services (if required) |
| 73 | +builder.Services.AddBlazorExpressBulma(); |
| 74 | + |
| 75 | +var app = builder.Build(); |
| 76 | +// ... your existing setup |
| 77 | +app.Run(); |
| 78 | + </code></pre> |
| 79 | + <p> |
| 80 | + <b>Note:</b> If <code>AddBlazorExpressBulma()</code> is not available, check the <a href="https://github.com/BlazorExpress/BlazorExpress.Bulma" target="_blank">official documentation</a> for the latest setup instructions. |
| 81 | + </p> |
| 82 | + </li> |
| 83 | + </ol> |
| 84 | + |
| 85 | + <h2>3. Usage Example</h2> |
| 86 | + <p> |
| 87 | + Add a Bulma component to <code>Pages/Index.razor</code>: |
| 88 | + </p> |
| 89 | + <pre><code> |
| 90 | +<BeButton Color="Color.Primary">Hello Bulma!</BeButton> |
| 91 | + </code></pre> |
| 92 | + |
| 93 | + <h2>4. Troubleshooting</h2> |
| 94 | + <ul> |
| 95 | + <li>Ensure all CSS and JS references are correct in <code>_Host.cshtml</code> or your layout file.</li> |
| 96 | + <li>Restart the development server after changes to static files.</li> |
| 97 | + <li>Check browser console for errors if components do not render as expected.</li> |
| 98 | + </ul> |
| 99 | + |
| 100 | + <h2>References</h2> |
| 101 | + <ul> |
| 102 | + <li> |
| 103 | + <a href="https://github.com/BlazorExpress/BlazorExpress.Bulma" target="_blank">BlazorExpress.Bulma GitHub Repository</a> |
| 104 | + </li> |
| 105 | + <li> |
| 106 | + <a href="https://www.nuget.org/packages/BlazorExpress.Bulma/" target="_blank">NuGet Package</a> |
| 107 | + </li> |
| 108 | + </ul> |
| 109 | +</div> |
| 110 | + |
| 111 | +@code { |
| 112 | + private const string pageUrl = RouteConstants.Demos_Getting_Started_WebApp_Server_NET_8; |
| 113 | + private const string pageTitle = "Getting started - Blazor WebApp (.NET 8) - Interactive render mode Server - Global location"; |
| 114 | + private const string pageDescription = "Learn how to quickly set up <code>BlazorExpress.Bulma</code> in your Blazor WebApp (Server) project using dotnet templates or manual installation, and how to register required services."; |
| 115 | + private const string metaTitle = "Getting started - Blazor WebApp (.NET 8) - Interactive render mode Server - Global location"; |
| 116 | + private const string metaDescription = "Step-by-step guide to using BlazorExpress.Bulma: dotnet templates, manual install, and service registration for Blazor WebApp (Server) apps."; |
| 117 | + private const string imageUrl = "https://i.imgur.com/FGgEMp6.jpg"; // TODO: update |
| 118 | +} |
0 commit comments