# NeoUI -- Components Reference NeoUI ships 100+ production-ready styled components. All require `@using NeoUI.Blazor`. ## Quick Import ```razor @using NeoUI.Blazor @using NeoUI.Blazor.Services @using NeoUI.Icons.Lucide ``` --- ## Inputs & Forms ### Button ```razor Click me ``` Variants: `Default` | `Secondary` | `Destructive` | `Outline` | `Ghost` | `Link` Sizes: `Default` | `Sm` | `Lg` | `Icon` ### Input ```razor ``` Types: text | password | email | number | search | url | tel ### Textarea ```razor ``` ### Checkbox ```razor Label text ``` ### Switch ```razor ``` ### RadioGroup ```razor Option A Option B ``` ### Select ```razor Option 1 Option 2 Option 3 ``` ### NativeSelect ```razor Option A Option B ``` ### Label ```razor Field Label ``` ### Field (Label + Input + Help Text) ```razor ``` ### Slider ```razor ``` ### RangeSlider ```razor ``` ### Toggle / ToggleGroup ```razor Bold ``` ### Rating ```razor ``` --- ## Advanced Inputs ### Calendar ```razor ``` Modes: `Single` | `Multiple` | `Range` ### DatePicker ```razor ``` ### DateRangePicker ```razor ``` ### TimePicker ```razor ``` ### Combobox ```razor Item 1 ``` ### MultiSelect ```razor Apple Banana ``` ### InputGroup ```razor Send ``` ### InputOtp ```razor ``` ### NumericInput ```razor ``` ### CurrencyInput ```razor ``` ### MaskedInput ```razor ``` ### FileUpload ```razor ``` ### MarkdownEditor ```razor ``` ### RichTextEditor ```razor ``` ### ColorPicker ```razor ``` --- ## Data Display ### Card ```razor Card Title Card description Card content here. Action ``` ### Badge ```razor New ``` Variants: `Default` | `Secondary` | `Destructive` | `Outline` | `Success` | `Warning` ### Avatar ```razor JD ``` ### DataGrid See `datagrid.txt` for the complete DataGrid reference. ```razor ``` ### DataTable ```razor @* Striped rows (3.6.3) *@ @* Pinned columns (3.6.2) *@ @* Client-side virtualization for large datasets (3.6.1) *@ @* Server-side virtualization (3.6.1) *@ @* Hierarchical/tree rows (3.6.2) *@ ``` ### FilterBuilder ```razor ``` Inline chip-based filter builder. 8 field types: `Text` | `Number` | `Date` | `DateRange` | `Boolean` | `Select` | `MultiSelect` | `Custom`. LINQ: `items.ApplyFilters(filters)`. See `components-full.txt` for presets and full reference. ### Skeleton ```razor ``` ### ScrollArea ```razor @* long content *@ ``` ### AspectRatio ```razor ``` ### Empty ```razor Create New ``` ### Item ```razor Document.pdf 2.4 MB ... ``` ### Kbd ```razor Ctrl + K ``` ### Typography ```razor Heading 1 Heading 2 Heading 3 Paragraph text Lead / intro text Muted text A quotation const x = 1; Item 1Item 2 ``` --- ## Navigation ### Breadcrumb ```razor Home Docs Components ``` ### Pagination ```razor ``` ### Sidebar ```razor Logo / Brand Navigation Dashboard User info / logout @Body ``` ### NavigationMenu (requires InteractiveAuto/Server render mode) ```razor Components Button About ``` ### Menubar ```razor File New Ctrl+N Exit ``` ### Command (Command Palette) ```razor No results found. New File Ctrl+N ``` ### ResponsiveNav ```razor MyApp Features Pricing Sign In ``` --- ## Overlays ### Dialog ```razor Open Dialog Dialog Title Description text. Dialog body content. Cancel Confirm ``` ### AlertDialog ```razor Delete Are you sure? This action cannot be undone. Cancel Delete ``` ### Sheet (Slide-out Panel) ```razor Open Sheet Panel Title Panel description. Sheet content. Save ``` Sides: `Top` | `Right` | `Bottom` | `Left` ### Drawer ```razor Open Drawer Title Content Close ``` ### Popover ```razor Settings Popover content ``` ### HoverCard ```razor @username U User bio here ``` ### DropdownMenu ```razor Options My Account Profile Settings Logout ``` ### ContextMenu ```razor Right-click me Copy Paste Delete @* Programmatic open at coordinates (3.6.2) *@ Action @code { ContextMenu? _ctxMenu; // Open programmatically (e.g. on canvas click, virtual list row, etc.) async Task OnCanvasClick(MouseEventArgs e) => await _ctxMenu!.OpenAt(e.ClientX, e.ClientY); } ``` `X` / `Y` parameters on `ContextMenuContent` set a fixed position. `OpenAt(x, y)` opens at runtime coordinates. ### Tooltip ```razor Helpful information ``` --- ## Feedback ### Alert ```razor Note This is an informational alert. ``` Variants: `Default` | `Info` | `Success` | `Warning` | `Destructive` ### Toast ```razor @inject IToastService ToastService Show Toast @code { void ShowToast() => ToastService.Show("Saved successfully!", ToastVariant.Success); } ``` Variants: `Default` | `Success` | `Error` | `Warning` | `Info` ### Progress ```razor ``` ### Spinner ```razor ``` Sizes: `Sm` | `Default` | `Lg` --- ## Layout ### Accordion ```razor Is it accessible? Yes. It adheres to WAI-ARIA design patterns. Is it styled? Yes. Pre-built CSS with shadcn/ui design. ``` Types: `AccordionType.Single` | `AccordionType.Multiple` ### Tabs (requires interactive render mode) ```razor Account Password Account settings... Password settings... ``` ### Collapsible ```razor Toggle Collapsible content here. ``` ### Separator ```razor @* horizontal *@ ``` ### Resizable ```razor Left panel Right panel ``` ### ButtonGroup ```razor Left Center Right ``` ### ThemeSwitcher / DarkModeToggle ```razor @* Full palette picker *@ @* Toggle light/dark *@ ``` ### DarkModeToggle ```razor ``` Sun/moon toggle that controls dark mode via `ThemeService`. Self-contained, no parameters needed. --- ## Charts (`@using NeoUI.Blazor.Charts`) All charts accept `Data`, `Width`, `Height`, and chart-specific configuration. ```razor @using NeoUI.Blazor.Charts @* Pie with custom slice colors (3.6.3) *@ @* Funnel / conversion pipeline *@ @* Gauge — single KPI, multi-tile, or progress ring *@ @* Heatmap — requires XAxis, YAxis, VisualMap *@ @* Candlestick — OHLC financial chart *@ ``` --- ## Animation ### Carousel ```razor Slide 1 Slide 2 Slide 3 ``` ### Motion ```razor Animated content ``` 20+ presets: `FadeIn`, `FadeOut`, `SlideInLeft`, `SlideInRight`, `SlideInUp`, `SlideInDown`, `ZoomIn`, `ZoomOut`, `Bounce`, `Pulse`, `Shake`, `Spin`, and more. ### HeightAnimation ```razor Animated height content ``` Animates height from `0` to `auto` when `Visible` changes. Zero JS required. See `components-full.txt` for full reference. ### PageTransition ```razor @* In MainLayout.razor *@ @Body ``` Fade (+ optional slide-from-bottom) on page navigation. Requires `RenderStateProvider` ancestor. SSR-safe — no animation during prerender. ### RenderStateProvider ```razor @* Wrap layout body *@ @Body @* Consume in child components *@ @code { [CascadingParameter] public AppRenderContext? RenderContext { get; set; } // RenderContext.IsInteractive, .IsHydrating, .IsEnhancedNavigation } ``` Cascades `AppRenderContext` to children. Required ancestor for `PageTransition`. --- ## DialogService (Programmatic Dialogs) ```csharp // Program.cs builder.Services.AddNeoUIComponents(); // includes IDialogService, ILocalizer // Localization (3.6.4+) -- override built-in English strings at startup builder.Services.AddNeoUIComponents(loc => { loc.Set("Combobox.Placeholder", "Waehlen Sie..."); loc.Set("DataTable.Loading", "Laden..."); // 70+ keys -- see /components/localization for full key reference }); // Option B: subclass DefaultLocalizer for .resx / IStringLocalizer integration // builder.Services.AddScoped(); ``` ```razor @inject IDialogService DialogService @code { async Task ShowConfirm() { var result = await DialogService.ShowAsync( title: "Confirm Delete", parameters: new() { ["Message"] = "Delete this item?" }); if (result.Confirmed) await DeleteItem(); } } ``` ### DialogHost ```razor @* In MainLayout.razor — place once *@ @* In a component *@ @inject IDialogService DialogService @code { async Task Delete() { var result = await DialogService.ShowAsync(new DialogOptions { Title = "Delete Item", Message = "Are you sure?", Buttons = DialogButtons.YesNo, Variant = DialogVariant.Destructive, Icon = "trash-2" }); if (result == DialogResult.Confirmed) await DeleteAsync(); } } ``` `DialogButtons`: `OkOnly` | `OkCancel` | `YesNo` | `YesNoCancel` `DialogVariant`: `Default` | `Destructive` | `Warning` | `Success` | `Info` --- ## New in 3.5 -- Advanced Components ### Timeline ```razor @* With custom icons and content *@ Deployment complete 2 hours ago v3.5.0 deployed to production. ``` Statuses: `Pending` | `Active` | `Completed` Aligns: `Left` | `Right` | `Alternate` ConnectorStyles: `Solid` | `Dashed` | `Dotted` Sizes: `Small` | `Default` | `Large` --- ### TreeView ```razor @* Multi-select with tri-state checkboxes *@ ``` SelectionModes: `None` | `Single` | `Multiple` --- ### DataView ```razor @p.Name@p.Price.ToString("C") @p.Name @* Responsive grid with min column width (3.6.1) -- overrides GridColumns *@ @p.Name @* Server-side infinite scroll *@ @o.Id ``` SelectionModes: `None` | `Single` | `Multiple` Layouts: `List` | `Grid` --- ### DynamicForm ```razor @* Define a schema *@ @code { private FormSchema _schema = new() { Fields = [ new FormFieldDefinition { Key = "name", Label = "Full Name", Type = FieldType.Text, IsRequired = true }, new FormFieldDefinition { Key = "email", Label = "Email", Type = FieldType.Email, IsRequired = true }, new FormFieldDefinition { Key = "role", Label = "Role", Type = FieldType.Select, Options = [new("admin","Admin"), new("user","User")] }, ] }; private Dictionary _values = new(); } ``` FieldTypes: `Text` | `Email` | `Password` | `Number` | `Date` | `DateRange` | `Select` | `MultiSelect` | `Checkbox` | `Switch` | `Slider` | `SliderRange` | `Textarea` | `Rating` | `ColorPicker` | `TimePicker` | `FileUpload` | `InputOtp` | `MaskedInput` | `CurrencyInput` | `RichText` | `MarkdownEditor` FormLayouts: `SingleColumn` | `TwoColumn` --- ### TagInput ```razor @* With async suggestions *@ @code { private List tags = new(); private async Task> SearchTags(string q) => await TagService.SearchAsync(q); } ``` Variants: `Default` | `Outlined` | `Ghost` Triggers (flags): `Enter` | `Comma` | `Tab` | `Space` | `Blur` --- ### SplitButton ```razor Save as Draft Save as Template Discard @* With variant and icon *@ Deploy to Staging Deploy to Production ``` --- ## New in 3.5 -- New Chart Types All new charts use `@using NeoUI.Blazor.Charts`. ### CandlestickChart ```razor ``` ### FunnelChart ```razor @* Custom color palette (3.6.3) *@ ``` Sorts: `Descending` | `Ascending` | `None` `Colors` cycles through the array for each segment; `null` = auto `--chart-1…5` palette. ### GaugeChart ```razor @* Single KPI *@ @* Multi-tile: each Gauge series drives one tile *@ @* Progress ring *@ @code { record Metric(string name, double value); } ``` ### HeatmapChart ```razor @code { record Cell(int hour, int day, int value); } ``` ### RadialBarChart ```razor ```
Card content here.
Dialog body content.
Sheet content.
Content
Popover content
User bio here
Collapsible content here.