Install the package Astrol.Component.Basic from AstrolUI's NuGet or reference the project in your solution.
Add the NuGet AstrolUi repository to the NuGet Package Manager Settings in your Visual Studio.
Source: https://nuget.astrolui.com/v3/index.json (Refer to documentation on how to configure package sources in Visual Studio)
Insert the .css elements into your index.html (WebAssembly) or _Host.cshtml (Blazor Server):
<!-- Reference to the UI themes. --><link href="_content/Astrol.Component.Basic/css/astrol-basic.min.css" rel="stylesheet" />Register the AstrolUI services in your app's Program with AddAstrolBasic(): it registers AstrolJSInterop, IAstrolToast (notifications) and IAstrolModal (confirmations and modals from code). No global .js file is needed anymore: each component loads its JavaScript only when it is used.
using Astrol.Component.Basic;public static async Task Main(string[] args) { //... //... ConfigureServices(builder.Services);//Add the method //... //...}private static void ConfigureServices(IServiceCollection services) { //New method services.AddAstrolBasic(); // AstrolJSInterop + IAstrolToast + IAstrolModal}Measured on version 10.0.13.1 in Release. NuGet is what is downloaded on install; the DLL is what the browser receives for each library (in parentheses, gzip-compressed; Blazor serves it with Brotli, even smaller). Third-party libraries (ApexCharts, pdf.js, Quill) and JavaScript modules are downloaded only when the component that uses them appears: a page without charts downloads nothing from ApexCharts.
| Package | NuGet | DLL (gzip) | On app load | Only when used |
|---|---|---|---|---|
Astrol.Component.Basic | 347 KB | 280 KB (109 KB) | astrol-basic.min.css 68 KB + component styles 74 KB + icons 43 KB of CSS and 24 KB of font (≈ 61 KB gzipped) | JS modules for modal, combo, menu, tooltip, dropdown and toasts (1–4 KB each); extra icon font 145 KB if the page uses one of those icons |
Astrol.Entities.Basic | 55 KB | 116 KB (40 KB) | The DLL only | — |
Astrol.JSInterop.Base | 38 KB | 40 KB (15 KB) | The DLL only | Its JS module, 15 KB (5 KB gzipped) |
Astrol.Shared.Repository | 30 KB | 28 KB (13 KB) | The DLL only | — |
Astrol.Component.Charts | 255 KB | 229 KB (85 KB) | The DLL only | ApexCharts 598 KB (142 KB gzipped) + styles and bridge 29 KB |
Astrol.Component.PDFViewer | 540 KB | 35 KB (14 KB) | The DLL only | pdf.js 344 KB + its worker 1.3 MB (≈ 490 KB gzipped) + viewer 20 KB |
Astrol.Component.RichText | 91 KB | 34 KB (13 KB) | The DLL only | Quill 237 KB (51 KB gzipped) + styles 30 KB |
Astrol.Component.Board | 96 KB | 142 KB (58 KB) | The DLL only | Drag and connection module 45 KB + styles 14 KB (≈ 14 KB gzipped) |
An app with Basic downloads on first start about 436 KB of AstrolUI DLLs (Basic + Entities + JSInterop, ≈ 164 KB gzipped) and ≈ 61 KB of styles and icons compressed; after that the browser caches them. For comparison: the Basic package weighed 1,921 KB before the redesign and its global CSS 220 KB split into four files with Bootstrap.