# 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 ****: always on top, Esc and focus handled by the browser. - **Texts in the app language** (English or Spanish) and **AstrolText.Resolver** to translate into other languages. - **GetColorContrast()**: picks the text color with the best contrast over a background. ```csharp // Program.cs builder.Services.AddAstrolBasic(); // Page or component @inject IAstrolToast Toast @inject IAstrolModal Modal if (await Modal.ConfirmAsync("Are you sure?", "The item will be deleted.")) { await Delete(item); Toast.Success("Deleted"); } var result = await Modal.ShowAsync("Edit", new Dictionary { ["Id"] = 5 }); if (!result.Cancelled) { var user = result.GetData(); } ``` ## 3. Accessibility and user experience - Every control can be used with the **keyboard**: real buttons in modals, menu, paging, sortable headers and filters; the menu uses real links (Ctrl+click opens a new tab). - **Visible focus** with the theme color when navigating with Tab. - Screen reader labels (**aria-label**, **aria-sort**, **aria-expanded**, table roles, alerts). - Respects the operating system **reduce motion** setting. - **Security**: notifications and menu names are plain text by default (no HTML injection). ## 4. How to migrate a project - **Program.cs**: replace **services.AddScoped()** with **services.AddAstrolBasic()** (**using Astrol.Component.Basic;**). - **index.html / _Host.cshtml**: - Remove **_content/Astrol.Component.Basic/js/interact.min.js** (if you use **Board**, change it to **_content/Astrol.Component.Board/js/interact.min.js**). - RichText paths move from **Astrol.Component.Basic** to **Astrol.Component.RichText**. - If your app uses **bootstrap** classes, reference bootstrap yourself. - Remove standalone links to **fontello.min.css** and **animation.min.css**: they are now inside **astrol-basic.min.css**. - **Notifications with HTML**: they are now plain text. Replace **
** with **\n** or use **AllowHtml = true** with trusted content. Same for **MenuItem.Name** (**NameIsHtml = true**). - **ConvertByteToMB()** now returns MB (it returned KB); use **ConvertBytesToKB()** for KB. - **Grid**: if you used ****, move **Context** to each ****; the **Load** parameter is gone. - **Themes without AstrolLayoutMenu**: add **data-aui-color** and **data-aui-mode** where you set the class (e.g. **green-dark-mode**). - **Custom CSS** on internal elements (**.head-astrol-modal i**, **.page-item a**, **#_pageInput**…): they are now buttons with classes; review your selectors. - **Optional**: move from **jsI.Notification(...)** to **IAstrolToast** and from **** to **IAstrolModal.ConfirmAsync**. The full guide, with every change, how to detect it (regular expressions) and before/after examples, is in the repository at **docs/refactor/MIGRATION.md**; it is written so an AI can also apply it to your project. ```csharp // ---- before ---- services.AddScoped(); await jsI.Notification("Saved
successfully".NotificationSuccess()); var ok = await _conf.Confirmation("Are you sure?", "Message"); // // ---- now ---- services.AddAstrolBasic(); Toast.Success("Saved\nsuccessfully"); var ok = await Modal.ConfirmAsync("Are you sure?", "Message"); ``` ```html ``` --- # Checkbox > AstrolCheckbox: Blazor checkbox on top of the native input, with @bind-Value, intermediate state, disabled state and EditForm validation. Source page: https://doc.astrolui.com/form/checkbox Checkbox with the theme look. ## 1. Demo AstrolCheckbox ```razor @using Astrol.Component.Basic.Form I want to receive the newsletter @* Select all: intermediate state (–) when only some are checked *@ @foreach (var key in items.Keys.ToList()) { var name = key; } @code { ``` ```csharp private bool remember = true; private bool news; private readonly Dictionary items = new() { ["A"] = true, ["B"] = false, ["C"] = false }; private bool allSelected => items.Values.All(v => v); private bool someSelected => items.Values.Any(v => v) && !allSelected; private void SelectAll(bool value) { foreach (var key in items.Keys.ToList()) items[key] = value; } } ``` I want to receive the **newsletter** ## 2. Inside an EditForm With **@bind-Value** inside an **EditForm**, the checkbox notifies validation of the change and turns red if it is invalid. Press Save without checking it. ```razor @code { private TermsModel terms = new(); private sealed class TermsModel { [Range(typeof(bool), "true", "true", ErrorMessage = "Accept the terms to continue.")] public bool Accepted { get; set; } } } ``` ### Supported parameters - Value **(bool)**, checked or not; binds with **@bind-Value**. - Text **(string)** or ChildContent **(RenderFragment)**, text or content next to the box; clicking it also toggles. - Indeterminate **(bool)**, intermediate state (–), e.g. "select all" with only some checked (default **false**). - Disabled **(bool)**, disabled (default **false**). - AriaLabel **(string)**, accessible text when there is no visible text. - Id **(string)** and Class **(string)**; other attributes (**name**, **title**...) go to the input. It is a native ****: it works with the keyboard (Space), screen readers and forms. AstrolGrid uses it to select rows. --- # ComboBox > AstrolComboBox is an interactive component that combines a text box with a dropdown list, allowing you to select an option from a variety of elements. Whether it's for filtering options, facilitating data entry, or providing contextual selections, AstrolComboBox stands as an elegant solution to enhance the user experience, offering flexibility and efficiency in interaction. Source page: https://doc.astrolui.com/form/combo-box ## 1. Demo AstrolComboBox ```razor @using Astrol.Component.Basic.Form
Id: @person?.Id
Name: @person?.Name
Age: @person?.Age
Sex: @person?.Sex
@code { ``` ```csharp private Person? person; List list = new List { new Person { Id = 1, Name = "Juan", Age = 25, Sex = true }, new Person { Id = 2, Name = "Ana", Age = 30, Sex = false }, new Person { Id = 3, Name = "Pedro", Age = 42, Sex = true }, new Person { Id = 4, Name = "María", Age = 19, Sex = false }, new Person { Id = 5, Name = "Carlos", Age = 55, Sex = true } }; public class Person { public int Id { get; set; } public string Name { get; set; } = string.Empty; public int Age { get; set; } public bool Sex { get; set; } } } ``` ### Supported parameters - TItem **(object)**, option type **(required)**. - DataList **(IEnumerable)**, options to display. - Display **(Func)**, text of each option, e.g. **Display="p => p.Name"(recommended)**. - PropertyShow **(string)**, alternative to Display using the property name (supports "A.B" paths). - Value **(TItem)** / **ValueChanged**, selected item; supports **@bind-Value**. - InitialValue **(TItem)**, initial value without two-way binding. - OnChange **(EventCallback)**, raised when the selection changes; **Value** holds the item or null. - Filtrable **(bool)**, filters while typing, ignoring case and accents (default **true**). - Placeholder **(string)**, input placeholder. - HasContentInput **(bool)**, uses the **AstrolContentInput** container (default **false**). - ShowOpenIcon **(bool)**, shows the open icon on the right, **only if HasContentInput is true** (default **false**). - PropertyShowIsHtml **(bool)**, option text is HTML. **Trusted content only**: it is inserted unescaped. - NoSearchResultText **(string)**, text when there are no results (default follows the app language). - Id **(string)** and Class **(string)**, HTML id and css class. - The selection is compared with **Equals**: **Value** / **InitialValue** must be an instance from **DataList** (or TItem must override Equals, e.g. a **record**). - When **Filtrable** is **false** the input is read-only. Typing text that exactly matches an option selects it; on leaving the field, if the text does not match the selection, both the text and the selection are cleared. - Methods (via **@ref**): **ChangeValue(item)** selects an item from code and **ChangeDataList(list, selected)** replaces the options (and optionally the selection). - Keyboard: **arrows** to move, **Enter** to select and **Esc** to close. The dropdown opens upwards when there is no room below and works inside grids and modals. --- # ContentInput > AstrolContentInput wraps an input, textarea or select (also InputText, InputSelect...) and gives it the AstrolUI look: border, height, hover and a focus ring in the theme color, with an optional icon button. Source page: https://doc.astrolui.com/form/content-input Gives your own fields the AstrolUI look and adds an action button to them. ## 1. What it is for AstrolUI **does not change your app's fields**: a bare **** looks the way the browser draws it. **AstrolContentInput** is the wrapper that gives them the AstrolUI look: same height as the buttons (38 px), theme border and radius, a stronger border on hover and a **focus ring** in the theme color while typing. It works with **input**, **textarea**, **select** and Blazor's components (**InputText**, **InputNumber**, **InputSelect**, **InputTextArea**...). Click the fields in each column to see the difference: Without AstrolContentInput ```razor @using Astrol.Component.Basic.Form @* Without the wrapper: the browser's own field *@ @* With the wrapper: AstrolUI look (border, height, radius, hover and focus ring in the theme color) *@ ``` ## 2. Icon button inside the field With **Icon** a button appears on the right of the field (the text leaves room for it) and **OnClickIcon** runs when it is pressed: clear, search, call, copy... Set **IconAriaLabel** for screen readers. **AstrolInputPassword** uses this same button to show or hide the password. ```razor ``` ## 3. Inside an EditForm Wrap Blazor's form components just like an input. When validation marks the field as **invalid**, the border turns red. **FocusRing="false"** removes the focus ring and **HasShadow="false"** the shadow, for quieter fields. Submit the empty form to see validation. ```razor ... ``` ## 4. No wrapper: aui-input and aui-textarea classes If you don't need the icon button, put the **aui-input** (or **aui-textarea**) class directly on the field and it gets the same look. ```razor @* Same look without the wrapper (no icon button and no extra margin) *@ ``` ### Supported parameters - ChildContent **(RenderFragment)**, field to wrap: **input**, **textarea**, **select** or a Blazor component (**InputText**, **InputSelect**...). - Icon **(string)**, icon of the button shown on the right of the field (**optional**). - OnClickIcon **(EventCallback)**, runs when the icon button is pressed. - IconAriaLabel **(string)**, accessible text of the icon button (defaults to the app's language). - FocusRing **(bool)**, focus ring in the theme color and stronger border on hover (default **true**). It used to be called **ShowEffect**. - HasShadow **(bool)**, soft shadow on the field (default **true**). - Class **(string)**, extra css class for the wrapper. --- # InputPassword > AstrolInputPassword focuses on privacy and security by hiding characters while the user types. By providing an additional level of confidentiality, it is ideal for forms and authentication processes where protecting sensitive information is paramount. Source page: https://doc.astrolui.com/form/inputs-password ## 1. Demo AstrolInputPassword using EditForm In this example, [notifications](/basic-component/notification), [buttons](/basic-component/button), [labels](/form/label), and [content inputs](/form/content-input) are implemented. It is recommended to refer to the documentation for each of them. ```razor @using Astrol.Component.Basic.Button @using Astrol.Component.Basic.Form @using System.ComponentModel.DataAnnotations @using Astrol.Entities.Basic.Static.Notification @using Astrol.Entities.Basic.UI @using Astrol.JSInterop.Base @inject AstrolJSInterop jsI
@code { ``` ```csharp public class Login { [Display(Name = "Password")] [Required(ErrorMessage = "Password required.")] [MinLength(6, ErrorMessage = "Minimum length of 6 characters.")] public string Password { get; set; } = string.Empty; } private Login login = new Login(); private async Task HandleValidSubmit() { await jsI.Notification("Sending form".NotificationSuccess("astrol-ok")); } } ``` ### Supported parameters - Value **(string)**, the password; bind it with **@bind-Value(required)**. It inherits **InputBase**: inside an **EditForm** it takes part in validation (**DataAnnotationsValidator**, **ValidationMessage**). - Id **(string)**, HTML id of the input (to link a label). - Class **(string)**, extra css class for the input. - Placeholder **(string)**, input placeholder. - ShowPassword **(bool)**, shows the password initially; the user can toggle it with the lock icon (default **false**). - Autocomplete **(bool)**, allows browser autocomplete; with **false** it uses **autocomplete="new-password"** (default **true**). - IconAriaLabel **(string)**, accessible text of the show/hide button (default follows the app language). - HasShadow **(bool)** and FocusRing **(bool)**, shadow and effect of the **AstrolContentInput** container (default **true**). - Other attributes (e.g. **maxlength**, **required**, **autofocus**) are applied to the input. --- # Label > AstrolLabel is an essential component in the user interface, designed to provide descriptive information and enhance the understanding of associated elements. Source page: https://doc.astrolui.com/form/label ## 1. Demo AstrolLabel ```razor @using Astrol.Component.Basic.Form @using System.ComponentModel.DataAnnotations @code { ``` ```csharp public class Login { public string User { get; set; } = string.Empty; [Display(Name = "Password")] public string Password { get; set; } = string.Empty; } private Login login = new Login(); } ``` ### Supported parameters - TItem **(T)**, model whose property is described **(required)**. - For **(string)**, name of the TItem property; it is also used as the label's **for** attribute, so the input must have an **id** equal to that name, e.g. **For="@nameof(Login.Password)"**. - ForExpression **(Expression>)**, typed alternative to For, e.g. **ForExpression="x => x.Password"**; used only when For is empty. - Text **(string)**, label text; when not set, the **Name** of the property's **[Display]** attribute is used, or the **property name** if there is none. - ChildContent **(RenderFragment)**, custom label content; when set, **Text is ignored**. --- # Radio > AstrolRadioGroup and AstrolRadio: Blazor radio options on top of the native input, of any type, in a column or a row, with @bind-Value and EditForm validation. Source page: https://doc.astrolui.com/form/radio One option among several, with the theme look. ## 1. Demo AstrolRadioGroup **AstrolRadioGroup** holds the chosen value and each **AstrolRadio** is an option with its **Value**. The type is inferred (text, numbers, enums...). With focus on an option, the arrows change the option. ```razor @using Astrol.Component.Basic.Form @* Any type: enums, numbers, objects... In a row with Horizontal *@ @foreach (var item in Enum.GetValues()) { } @code { ``` ```csharp private string? payment = "card"; private AstrolThemeMode theme = AstrolThemeMode.Auto; } ``` ### Supported parameters **AstrolRadioGroup** - Value **(TValue)**, chosen value; binds with **@bind-Value** (validated inside an **EditForm**). - Horizontal **(bool)**, options in a row (default **false**, in a column). - Disabled **(bool)**, disables every option. - Name **(string)**, **name** attribute of the inputs (default: a unique one per group). - AriaLabel **(string)**, the group's question for screen readers. - Class **(string)**, extra css class. **AstrolRadio** - Value **(TValue)**, value of the option. - Text **(string)** or ChildContent **(RenderFragment)**, option text or content. - Disabled **(bool)**, disabled option. - Id **(string)** and Class **(string)**; other attributes go to the input. --- # Toggle > AstrolToggle is an accessible switch to turn an option on or off with a click or from the keyboard. Source page: https://doc.astrolui.com/form/toggle ## 1. Demo AstrolToggle ```razor @using Astrol.Component.Basic.Form @code { ``` ```csharp private bool value = true; } ``` ### Supported parameters - Value **(bool)** / **ValueChanged**, switch state (default **false**); supports **@bind-Value**. - OnChange **(EventCallback)**, raised when the state changes, with the new value. - Object **(object)**, associated object returned in **OnChangeObject** (useful in lists or grids). - OnChangeObject **(EventCallback<(object?, bool)>)**, raised when the state changes, with the associated object and the new value. - Disable **(bool)**, disables the switch (default **false**). - Id **(string)**, HTML id of the button; lets you link a **