# AstrolUI
> If you're looking to streamline development with .Net and Blazor using this technology in the lightest way possible, our free components will provide the perfect solution to boost your project.
Source page: https://doc.astrolui.com/
## ((MarkupString)$"{_localizer["hm_hero_title"]}")
Blazor components for .NET 10: examples you can try right here, code ready to copy and every parameter of each component.
Looking for something specific? Press Ctrl K to search the whole documentation.
### Start here
### Catalog
### What's new
### Community and contact
Questions, ideas or a project with AstrolUI? Write to us or follow us.
Creator of AstrolUI · LinkedIn
Basic, Charts, PDFViewer, RichText and Repository are free; Board has a commercial license. [See the license](/license)
---
# Installation
> Install the Astrol.Component.Basic package from the AstrolUI NuGet. Add in the NuGet Package Manager Settings of your Visual Studio.
Source page: https://doc.astrolui.com/basic-component/installation
## Video tutorial
## 1. Installation process
Remove all references to the css files included by default in the Blazor project template.
**AstrolUI does not include bootstrap**: **astrol-basic.min.css** ships its own reboot, icons and animations in a single file. If your app uses bootstrap classes, reference it yourself **beforeastrol-basic.min.css**.
Install the package **Astrol.Component.Basic** from [**AstrolUI's NuGet**](https://nuget.astrolui.com/) 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)](https://learn.microsoft.com/es-es/nuget/consume-packages/install-use-packages-visual-studio#package-sources)
Insert the **.css** elements into your **index.html (WebAssembly)** or **_Host.cshtml (Blazor Server)**:
```html
```
**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.
```csharp
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
}
```
## 2. Package sizes
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.
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.
---
# For AI
> AstrolUI documentation for AI: llms.txt, llms-full.txt and every page in Markdown with its real code, so Claude, Copilot or Cursor write correct AstrolUI code.
Source page: https://doc.astrolui.com/for-ai
The documentation in Markdown for AI assistants (llms.txt).
AI assistants (Claude Code, GitHub Copilot, Cursor, ChatGPT...) don't need to read the pages like a person: the menu, demos and styles only use up their context. That's why the documentation is also published in **Markdown**, following the [llms.txt](https://llmstxt.org) format: clean text, every component's parameters and the real example code (the same these docs run), in English.
## 1. Use it in your project
Add these lines to your assistant's instructions file (Claude Code reads **CLAUDE.md**, GitHub Copilot **.github/copilot-instructions.md** and Cursor **.cursor/rules**). Then, when it writes AstrolUI code, it checks the documentation instead of making up parameters. In a chat you can also paste the **llms-full.txt** link or the component page link.
```html
## AstrolUI
This project uses AstrolUI (Blazor, .NET 10). Before writing UI code, read https://doc.astrolui.com/llms.txt
and open the page of each component you use (https://doc.astrolui.com/ai/.txt).
For code written for older AstrolUI versions follow https://doc.astrolui.com/ai/migration.txt
```
## 2. From every page
At the bottom of every page there is a **Markdown for AI** link that opens the same page in AI format.
## 3. How it is kept up to date
The files are generated from the pages' texts and code, so nothing is written twice. After changing the docs, regenerate them:
```bash
python 2-Shared/tools/docs_ai_export.py # llms.txt, llms-full.txt and wwwroot/ai/*.txt
python 2-Shared/tools/docs_search_index.py # search index of these docs
```
---
# License
> AstrolUI license: Basic, PDFViewer, Charts, RichText and Repository are free for personal and commercial projects; Board requires a commercial license.
Source page: https://doc.astrolui.com/license
Free components and advanced packages under a commercial license.
Personal and commercial projects
A license is required to use them
#### **1.** Free packages
- They can be used at no cost in personal or commercial projects, including ones that are sold or offered as a service.
- They may not be redistributed as part of a public library, framework, template or development tool, nor sold separately.
#### **2.** Packages under a commercial license
- Using them in any project (personal or commercial) that is published or put into production requires a valid AstrolUI license.
- They can be tried without a license only in local development and test environments that don't serve end users.
- License terms (projects, developers, duration, updates and price) are agreed in writing; request one at [astrol@astrolui.com](mailto:astrol@astrolui.com).
- The NuGet repository will soon require credentials to download these packages.
#### **3.** Common terms
- **Source code:** not available. Decompiling, reverse engineering or modifying the packages is not allowed.
- **Intellectual property:** all rights to the code, design and functionality of the `Astrol.` packages belong to Asley F. Cruz. Use grants no rights beyond those stated here.
- **Support:** not guaranteed for the free packages; for commercial ones it is what each license states.
- **Liability:** the packages are provided "as is", without warranties of any kind. The author is not liable for direct or indirect damages arising from their use.
- **Third-party components:** Astrol.Component.Charts includes ApexCharts 3.50 (MIT license) and Astrol.Component.PDFViewer includes PDF.js (Apache 2.0 license); those parts are governed by their own licenses.
Official, current text: [astrolui.com/license](https://astrolui.com/license).
---
# Overview
> The basic components together, as in a real screen: buttons, tags, form, file upload, grid, confirmation and notifications.
Source page: https://doc.astrolui.com/overview
The basic components together, as in a real screen: buttons, tags, form, file upload, grid, confirmation and notifications.
### Buttons and tags
One main action per view; the rest, secondary or outlined. Press «Delete» to see the confirmation and the notifications.
Changes are synced every 5 minutes.
New: tabs, checkboxes and radios.
### Form
### File upload
### Grid
---
# Theme
> AstrolUi offers a vibrant color palette for .Net Blazor, where each color represents a unique theme. It allows for 100% customization, enabling you to personalize the themes according to your preferences.
Source page: https://doc.astrolui.com/theme
Theme color and light/dark mode. Changes apply right away, without reloading the page.
## 1. Theme color
Pick a color: the docs change right away (same as the circles in the top bar) and it is remembered next time.
## 2. Mode
Automatic follows the operating system preference and changes live when the user changes it.
## 3. Design tokens
AstrolUI exposes its visual system as CSS variables with the **--aui-** prefix. They change by themselves with the theme color (**data-aui-color**) and the mode (**data-aui-mode**), so your own CSS stays consistent without extra work.
- **Surfaces:** --aui-bg (page background), --aui-surface (cards, fields), --aui-surface-2 (headers, footers), --aui-surface-hover.
- **Text:** --aui-text, --aui-text-2 (secondary), --aui-text-3 (hints, quiet icons); --aui-link.
- **Borders:** --aui-border, --aui-border-strong.
- **Brand:** --aui-brand, --aui-brand-strong, --aui-on-brand (text on the brand), --aui-brand-soft (tint), --aui-brand-text (text on the tint), --aui-brand-ring and --aui-focus-ring (focus).
- **States:** --aui-danger, --aui-success, --aui-warning, --aui-info.
- **Shape and motion:** --aui-radius-sm / --aui-radius / --aui-radius-lg / --aui-radius-pill (6 / 8 / 12 / 999 px), --aui-h-control (38 px), --aui-shadow-sm / --aui-shadow / --aui-shadow-lg, --aui-dur, --aui-ease.
- **Typography:** --aui-font, --aui-font-mono, --aui-text-xs / sm / md / lg / xl (12 / 13 / 14 / 16 / 20 px).
The old variables (--color-base, --background, --layout-*...) still exist as aliases of these tokens so existing CSS keeps working.
```css
/* Use the tokens in your own CSS: they follow the theme color and light/dark mode */
.my-card {
background: var(--aui-surface);
border: 1px solid var(--aui-border);
border-radius: var(--aui-radius-lg);
box-shadow: var(--aui-shadow-sm);
color: var(--aui-text);
}
.my-card small { color: var(--aui-text-2); }
.my-card .highlight { background: var(--aui-brand-soft); color: var(--aui-brand-text); }
.my-card .action { background: var(--aui-brand); color: var(--aui-on-brand); }
/* Your own brand color: override it in a theme */
[data-aui-color="blue"] { --aui-brand: #0057b8; --aui-brand-strong: #003f86; --aui-on-brand: #fff; }
```
## 4. Change the theme in your app
**AstrolLayoutMenu** applies the color (**Style**) and the mode (**Mode**). Change those variables and the layout repaints without reloading; with **AstrolThemeSwitcher** the user does it from the top bar. Save the preference wherever you want (localStorage, user profile...).
```razor
...
@code {
private AstrolTheme theme = AstrolTheme.Yellow;
private AstrolThemeMode mode = AstrolThemeMode.Auto;
}
```
## 5. Your own theme
Besides the six colors, AstrolUI accepts any brand color. Every component of every package (buttons, forms, table, menu, charts, board, editor, PDF viewer...) is painted with three variables: **--aui-brand**, **--aui-brand-strong** and **--aui-on-brand**; soft shades, the focus ring and the rest derive from them. With **data-aui-color="custom"** those variables come from **--aui-custom-brand** (and optionally **--aui-custom-brand-strong** and **--aui-custom-on-brand**).
**AstrolCustomTheme** (Astrol.Entities.Basic) computes all three from a single color: the strong shade and the text color (white or dark) with the most contrast. AstrolThemeSwitcher is not required: the color can come from settings, the database (one color per customer) or a color field. Pick a color here to apply it to the whole documentation.
```razor
@* 1. With AstrolLayoutMenu: Style = Custom + CustomColor (also applied to ) *@
...
@* 2. On any container (or ), without the layout *@
@* buttons, grid, toggles, charts... use the color *@
@* 3. For the whole app from C# (e.g. the color of each customer, read from the database) *@
```
```css
/* CSS only: one variable is enough (the strong shade and the text color have defaults) */
:root { --aui-custom-brand: #0ea5e9; }
/* Or a named theme of your own: data-aui-color="acme" */
[data-aui-color="acme"] {
--aui-brand: #0f766e; /* buttons, focus, selection, active menu item */
--aui-brand-strong: #115e59; /* hover and text over light backgrounds */
--aui-on-brand: #ffffff; /* text on top of the color */
}
```
---
# What's new
> What's new in AstrolUI for .NET 10: lighter and faster, notification and modal services, automatic mode, accessibility and migration guide.
Source page: https://doc.astrolui.com/whats-new
This release of **AstrolUI for .NET 10** is a full overhaul of **Astrol.Component.Basic** and its dependencies, focused on **performance**, **size**, **user experience** and **accessibility**. The **astrol-*** icon names do not change. Some changes break the previous API: the steps to migrate your projects are at the end of this page.
## 1. Lighter and faster
- **Global CSS**: from 220 KB in 4 chained files (with bootstrap) to **68 KB in a single file** (15 KB compressed).
- **interact.js** (126 KB) is no longer loaded: drag and resize are native and only downloaded when used.
- **Icons**: a **24 KB** core with the component icons and the most common ones; the rest (145 KB) is only downloaded when a page uses one.
- **On-demand JavaScript**: each component (modal, combo, editor…) loads its module only when it appears.
- **NuGet package** for Basic: from 1,921 KB to **347 KB**, now including the new components (tabs, checkbox, radio, dropdown, tooltip, alerts and badges). Details for each package in [Installation](/basic-component/installation).
- **Grid**: no longer copies the data or uses one component per cell. With 2,000 rows, re-rendering the page goes from 16 ms to **0.9 ms**, sorting from 476 ms to **47 ms** and filtering from 379 ms to **36 ms**.
## 2. New
- **IAstrolToast**: notifications from code (**Toast.Success("Saved")**), rendered by Blazor, pausing on hover and following the theme. [See Notification](/basic-component/notification).
- **IAstrolModal**: **await Modal.ConfirmAsync(...)** and **await Modal.ShowAsync(...)** with a result, without **@ref**. [See Confirm](/basic-component/confirm).
- **Automatic mode**: the theme follows the operating system light or dark mode and changes live; notifications and browser controls follow the theme too. [See Layout menu](/basic-component/layout-menu).
- **Grid**: typed **Field** and nested paths, **Format**, **Virtualize**, and column width is kept when paging. [See Grid](/basic-component/grid).
- **ComboBox**: **Display="p => p.Name"** and **@bind-Value**; opens upwards when there is no room and works inside grids and modals. [See ComboBox](/form/combo-box).
- **Modal** as a native **