Aesthetic C# .NET Blazor component library that makes UI seamless and entertaining to use.
- .NET 10 (net10.0).
- Blazor Server or Blazor Web App (Interactive Server).
dotnet add package ChatAIze.DopamineUIInstall-Package ChatAIze.DopamineUIInclude the Dopamine UI stylesheet in your app head.
Blazor Server / Web App (App.razor):
<head>
<!-- ... -->
<link rel="stylesheet" href="_content/ChatAIze.DopamineUI/css/tailwind.css">
<!-- ... -->
</head>Loading indicators and some visuals are delivered as static web assets. Ensure static assets are mapped:
app.MapStaticAssets();Add these to your app _Imports.razor:
@using ChatAIze.Abstractions.UI
@using ChatAIze.DopamineUI
@using ChatAIze.DopamineUI.Components
@using ChatAIze.DopamineUI.Enums
@using ChatAIze.DopamineUI.Interfaces
@using Microsoft.AspNetCore.Components.Web@page "/"
<DPPage Title="Welcome">
<DPCard Label="Sign in" IsFullWidth="true">
<DPTextField Label="Email" Type="TextFieldType.Email" @bind-Value="email" />
<DPTextField Label="Password" Type="TextFieldType.Password" @bind-Value="password" />
<DPButton Style="ButtonStyle.Primary" IsLoading="isSaving" Clicked="SaveAsync">
Sign in
</DPButton>
</DPCard>
</DPPage>
@code {
private string email = string.Empty;
private string password = string.Empty;
private bool isSaving;
private async Task SaveAsync()
{
isSaving = true;
try
{
await Task.Delay(500);
}
finally
{
isSaving = false;
}
}
}- Prefer
@bind-Valueover manualValueandValueChangedwiring for inputs. - Use
IsLoadingon interactive components to block multiple submissions and show feedback. - Use
DPGrouporDPPageto cascadeIsDisabledthrough a subtree. - Use stable equality for generic components (
DPDropDown<T>,DPSegmentedControl<T>,DPRadioGroup<T>). - Provide
From/Toranges forDPDatePickerto avoid invalid selections. - Use
Tagto attach view models or IDs without rendering them.
LoadingIndicatorSizecontrolsDPLoadingIndicatorsize.ScreenSizeprovides Tailwind-aligned breakpoints forDPAdaptiveViewandDPBreakpoint.TailwindColoris used byDPColorPicker.I1ColumnRepresentablethroughI5ColumnRepresentableare used byDPTable<T>.ITaggableprovides aTagproperty on most components for user metadata.
Page wrapper that sets the document title and renders a loading overlay.
Parameters:
Title: Title text. When set, it updates<PageTitle>andDPNavigationTitle.BackUrl: Back navigation path forDPNavigationTitle.ChildContent: Page content.IsLoading: ShowsDPLoadingScreenand disables content.IsDisabled: Disables the page content.Tag: User data.
Remarks:
- Tip: Use
Titlefor consistent page titles across navigation and browser tabs. - Warning: Loading uses static assets under
/_content/ChatAIze.DopamineUI/img.
Example:
<DPPage Title="Dashboard" IsLoading="isLoading">
<DPHeader>Overview</DPHeader>
</DPPage>Card container with optional label and loading overlay.
Parameters:
Label: Optional header label.ChildContent: Card body content.IsFullWidth:truefor full width,falsefor fit,nullfor responsive.IsTopPaddingExtended: Adds extra top padding.IsBottomPaddingExtended: Adds extra bottom padding.IsLoading: Shows a loading overlay and disables content.IsDisabled: Disables the card content.Tag: User data.
Remarks:
- Tip: Combine with
DPGroupto disable nested content consistently.
Example:
<DPCard Label="Profile" IsFullWidth="true">
<DPTextField Label="Display name" @bind-Value="name" />
</DPCard>Cascades IsDisabled to its children without adding markup.
Parameters:
ChildContent: Group content.IsDisabled: Disables the group content.Tag: User data.
Remarks:
- Limitation: No DOM wrapper is rendered.
Example:
<DPGroup IsDisabled="isBusy">
<DPButton Clicked="SaveAsync">Save</DPButton>
</DPGroup>Switches between stacked and horizontal layouts based on screen size.
Parameters:
ChildContent: Content to arrange.RequiredSize: Minimum screen size for horizontal layout.IsDisabled: Disables child interactions.Tag: User data.
Remarks:
- Limitation: Uses CSS visibility only; content is always rendered.
Example:
<DPAdaptiveView RequiredSize="ScreenSize.Large">
<DPCard>Left</DPCard>
<DPCard>Right</DPCard>
</DPAdaptiveView>Shows or hides content within a breakpoint range.
Parameters:
FromSize: Minimum breakpoint where content becomes visible.ToSize: Breakpoint where content becomes hidden.ChildContent: Content to show or hide.IsDisabled: Disables child interactions.Tag: User data.
Remarks:
- Limitation: Uses CSS visibility only; content stays in the DOM.
Example:
<DPBreakpoint FromSize="ScreenSize.Medium" ToSize="ScreenSize.ExtraLarge">
<DPParagraph>Visible on md to xl.</DPParagraph>
</DPBreakpoint>Overlay container that can show or hide its content.
Parameters:
ChildContent: Overlay content.IsVisible: Shows the overlay.IsDisabled: Disables the overlay content.Tag: User data.
Remarks:
- Warning: No focus trap or body scroll lock is provided.
Example:
<DPOverlay IsVisible="isOpen">
<DPCard>Overlay content</DPCard>
</DPOverlay>Primary heading (h1).
Parameters:
ChildContent: Header text or content.IsDisabled: Disables the header styling.Tag: User data.
Remarks:
- Tip: Use semantic headings to improve accessibility and SEO.
- Limitation: This component is purely visual and adds no behavior.
Example:
<DPHeader>Settings</DPHeader>Secondary heading (h2).
Parameters:
ChildContent: Subheader text or content.IsDisabled: Disables the subheader styling.Tag: User data.
Remarks:
- Tip: Use for section titles that follow
DPHeader. - Limitation: This component is purely visual and adds no behavior.
Example:
<DPSubheader>Profile</DPSubheader>Paragraph text.
Parameters:
ChildContent: Paragraph text or content.IsDisabled: Disables the paragraph styling.Tag: User data.
Remarks:
- Tip: Use for body text and helper copy.
- Limitation: This component is purely visual and adds no behavior.
Example:
<DPParagraph>Short helper text.</DPParagraph>Horizontal divider.
Parameters:
Tag: User data.
Remarks:
- Limitation: Decorative only, no label or content support.
Example:
<DPDivider />Styled button with optional loading state and caption.
Parameters:
ChildContent: Button content.Caption: Helper text below the button.Style:ButtonStyleenum value.IsFullWidth:truefor full width,falsefor fit,nullfor responsive.IsLoading: Shows a loading indicator and disables click.IsDisabled: Disables click and styling.Clicked: Click callback.Tag: User data.
Remarks:
- Warning: Loading indicator uses static assets under
/_content/ChatAIze.DopamineUI/img.
Example:
<DPButton Style="ButtonStyle.Accent" IsLoading="isSaving" Clicked="SaveAsync">
Save
</DPButton>Toggleable button for boolean values.
Parameters:
Value: Current value.ValueChanged: Value change callback.ChildContent: Button content.Caption: Helper text below the button.IsFullWidth:truefor full width,falsefor fit,nullfor responsive.IsLoading: Shows a loading indicator and disables click.IsDisabled: Disables click and styling.Tag: User data.
Remarks:
- Tip: Use
@bind-Valuefor two-way binding. - Limitation: Not an
InputBasecomponent.
Example:
<DPToggleButton @bind-Value="isOn">
Toggle
</DPToggleButton>Switch-style toggle for boolean values.
Parameters:
Label: Label next to the switch.Caption: Helper text below the switch.Value: Current value.ValueChanged: Value change callback.IsBorderless: Removes the border styling whentrue.IsFullWidth:truefor full width,falsefor fit,nullfor responsive.IsDisabled: Disables input and styling.Tag: User data.
Remarks:
- Limitation: Not an
InputBasecomponent.
Example:
<DPToggleSwitch Label="Airplane mode" @bind-Value="isAirplane" />Single-line input with optional Enter callback.
Parameters:
Type:TextFieldTypeenum value.Label: Label text.Caption: Helper text below the field.Placeholder: Placeholder text.Value: Current value.ValueChanged: Value change callback.Size: Input size attribute.MaxLength: Maximum length.IsFullWidth:truefor full width,falsefor fit,nullfor responsive.IsLowercase: Normalizes input to lowercase.IsReadOnly: Prevents editing but keeps focus.IsEdited: Shows the edit indicator.IsLoading: Shows a loading indicator and disables input.IsDisabled: Disables input and styling.Tag: User data.EnterPressed: Callback when Enter is pressed.
Remarks:
- Limitation: Not an
InputBasecomponent, so it does not integrate withEditFormvalidation automatically.
Example:
<DPTextField Label="Email" Type="TextFieldType.Email" @bind-Value="email" EnterPressed="SearchAsync" />Multi-line text input.
Parameters:
Label: Label text.Caption: Helper text below the field.Placeholder: Placeholder text.Value: Current value.ValueChanged: Value change callback.Size: Column size.Lines: Number of visible rows.MaxLength: Maximum length.IsFullWidth:truefor full width,falsefor fit,nullfor responsive.IsLowercase: Normalizes input to lowercase.IsReadOnly: Prevents editing but keeps focus.IsEdited: Shows the edit indicator.IsLoading: Shows a loading indicator and disables input.IsDisabled: Disables input and styling.Tag: User data.
Remarks:
- Limitation: Not an
InputBasecomponent, so it does not integrate withEditFormvalidation automatically.
Example:
<DPTextArea Label="Description" Lines="4" @bind-Value="description" />Checkbox input.
Parameters:
Label: Label text.Caption: Helper text below the checkbox.Value: Current value.ValueChanged: Value change callback.IsBorderless: Removes the border styling whentrue.IsFullWidth:truefor full width,falsefor fit,nullfor responsive.IsDisabled: Disables input and styling.Tag: User data.
Remarks:
- Limitation: Not an
InputBasecomponent.
Example:
<DPCheckBox Label="Remember me" @bind-Value="rememberMe" />Radio group and radio button options.
Parameters for DPRadioGroup<T>:
Label: Group label.Caption: Helper text below the group.Value: Current selected value.ValueChanged: Selection change callback.ChildContent: Radio button items.IsBorderless: Removes borders whentrue.IsFullWidth:truefor full width,falsefor fit,nullfor responsive.IsEdited: Shows the edit indicator.IsDisabled: Disables the group.Tag: User data.
Parameters for DPRadioButton<T>:
Label: Label text.Caption: Helper text below the radio button.Value: Value for this option.IsBorderless: Overrides border styling.IsFullWidth: Overrides width behavior.IsDisabled: Disables the option.Tag: User data.
Remarks:
- Tip: Use simple value types or implement stable equality.
Example:
<DPRadioGroup T="string" Label="Plan" @bind-Value="plan">
<DPRadioButton Value="Basic" Label="Basic" />
<DPRadioButton Value="Pro" Label="Pro" />
</DPRadioGroup>Segmented selector for discrete values.
Parameters for DPSegmentedControl<T>:
Label: Group label.Caption: Helper text below the control.Value: Current selected value.ValueChanged: Selection change callback.ChildContent: Segment items.IsFullWidth:truefor full width,falsefor fit,nullfor responsive.IsEdited: Shows the edit indicator.IsDisabled: Disables the control.Tag: User data.
Parameters for DPSegment<T>:
Value: Value for this segment.ChildContent: Segment content.IsDisabled: Disables the segment.Tag: User data.
Remarks:
- Tip: Use simple value types or implement stable equality.
- Limitation: No keyboard navigation is provided.
Example:
<DPSegmentedControl T="string" Label="View" @bind-Value="view">
<DPSegment Value="List">List</DPSegment>
<DPSegment Value="Grid">Grid</DPSegment>
</DPSegmentedControl>Dropdown selector for discrete values.
Parameters for DPDropDown<T>:
Label: Label text.Caption: Helper text below the dropdown.Value: Current selected value.ValueChanged: Selection change callback.ChildContent: Dropdown items.IsFullWidth:truefor full width,falsefor fit,nullfor responsive.IsScrollable: Enables scrolling for the options list.IsEdited: Shows the edit indicator.IsLoading: Shows a loading indicator and disables input.IsDisabled: Disables the dropdown.Tag: User data.
Parameters for DPDropDownItem<T>:
Value: Value for this option.ChildContent: Option content.IsDisabled: Disables the option.Tag: User data.
Remarks:
- Tip: Ensure
Equalsis stable for custom value types so selection and labels resolve correctly. - Limitation: No outside click close or keyboard navigation is provided.
Example:
<DPDropDown T="string" Label="Theme" @bind-Value="theme">
<DPDropDownItem Value="Light">Light</DPDropDownItem>
<DPDropDownItem Value="Dark">Dark</DPDropDownItem>
</DPDropDown>Palette picker for Tailwind color families.
Parameters:
Label: Label text.Caption: Helper text below the picker.Value: Current selected color.ValueChanged: Selection change callback.IsFullWidth:truefor full width,falsefor fit,nullfor responsive.IsEdited: Shows the edit indicator.IsDisabled: Disables input.Tag: User data.
Remarks:
- Limitation: The UI exposes a curated subset of
TailwindColorvalues.
Example:
<DPColorPicker Label="Accent" @bind-Value="accent" />Expandable section that reveals content when opened.
Parameters:
Label: Header text.ChildContent: Content revealed when open.IsBottomPaddingExtended: Adds extra bottom padding when open.IsLoading: Shows loading styling and disables toggle.IsDisabled: Disables toggle.Tag: User data.
Remarks:
- Limitation: The open state is internal and cannot be controlled externally.
Example:
<DPSpoiler Label="Advanced">
<DPTextField Label="Secret" />
</DPSpoiler>Range slider for integer values.
Parameters:
Label: Label text.Caption: Helper text below the slider.Unit: Unit suffix.Value: Current value.ValueChanged: Value change callback.Step: Step size.MinValue: Minimum value.MinValueLabel: Custom label for minimum.MaxValue: Maximum value.MaxValueLabel: Custom label for maximum.IsShowingValue: Displays value next to label.IsShowingMaxValue: Displays maximum next to label.IsShowingPercentage: Displays percentage next to label.IsFullWidth:truefor full width,falsefor fixed,nullfor responsive.IsEdited: Shows the edit indicator.IsDisabled: Disables input.Tag: User data.
Remarks:
- Limitation: Values outside the range are ignored.
Example:
<DPSlider Label="Volume" MinValue="0" MaxValue="100" @bind-Value="volume" IsShowingPercentage="true" />Range slider for double values.
Parameters:
Label: Label text.Caption: Helper text below the slider.Unit: Unit suffix.Value: Current value.ValueChanged: Value change callback.Step: Step size.MinValue: Minimum value.MinValueLabel: Custom label for minimum.MaxValue: Maximum value.MaxValueLabel: Custom label for maximum.IsShowingValue: Displays value next to label.IsShowingMaxValue: Displays maximum next to label.IsShowingPercentage: Displays percentage next to label.IsFullWidth:truefor full width,falsefor fixed,nullfor responsive.IsEdited: Shows the edit indicator.IsDisabled: Disables input.Tag: User data.
Remarks:
- Limitation: Values outside the range are ignored.
Example:
<DPDecimalSlider Label="Opacity" MinValue="0" MaxValue="1" Step="0.05" @bind-Value="opacity" />Numeric input with increment and decrement buttons.
Parameters:
Label: Label text.Caption: Helper text below the stepper.Value: Current value.ValueChanged: Value change callback.MinValue: Minimum value.MaxValue: Maximum value.Step: Step size.IsFullWidth:truefor full width,falsefor fit,nullfor responsive.IsEdited: Shows the edit indicator.IsLoading: Shows a loading indicator and disables input.IsDisabled: Disables input.Tag: User data.
Remarks:
- Warning: Invalid text input is ignored and may require external validation.
Example:
<DPStepper Label="Quantity" MinValue="1" MaxValue="10" @bind-Value="quantity" />Dropdown calendar date picker.
Parameters:
Label: Label text.Caption: Helper text below the picker.Value: Current date value.ValueChanged: Value change callback.From: Earliest selectable date (inclusive).To: Latest selectable date (inclusive).IsFullWidth:truefor full width,falsefor fit,nullfor responsive.IsEdited: Shows the edit indicator.IsLoading: Shows a loading indicator and disables input.IsDisabled: Disables input.Tag: User data.
Remarks:
- Warning: Selected dates are normalized to UTC (TimeSpan.Zero).
- Limitation: There is no text input or keyboard navigation.
Example:
<DPDatePicker Label="Start" From="minDate" To="maxDate" @bind-Value="startDate" />Time picker with optional seconds selection.
Parameters:
Label: Label text.Caption: Helper text below the picker.Value: Current time value.ValueChanged: Value change callback.IsShowingSeconds: Shows seconds whentrue.IsFullWidth:truefor full width,falsefor fit,nullfor responsive.IsEdited: Shows the edit indicator.IsLoading: Shows a loading indicator and disables input.IsDisabled: Disables input.Tag: User data.
Remarks:
- Warning: Uses 24-hour formatting.
- Limitation: Value changes are raised only while the picker is open.
Example:
<DPTimePicker Label="Time" IsShowingSeconds="true" @bind-Value="time" />Simple table that renders items implementing column interfaces.
Parameters:
Column1toColumn5: Column headers.Data: Data items to render.IsFullWidth:truefor full width,falsefor fit,nullfor responsive.IsDisabled: Disables styling.Tag: User data.
Remarks:
- Tip: Implement
I1ColumnRepresentablethroughI5ColumnRepresentablefor row data. - Limitation: Column values are strings, and no templating, sorting, paging, or virtualization is provided.
Example:
<DPTable T="StoreItem" Column1="Item" Column2="Price" Column3="Qty" Data="items" />Progress bar with optional labels.
Parameters:
Label: Label text.Caption: Helper text below the bar.Unit: Unit suffix.Value: Current value.ZeroLabel: Label shown at zero.MaxValue: Maximum value.MaxValueLabel: Label shown at maximum.IsShowingValue: Shows numeric value.IsShowingMaxValue: Shows maximum value.IsShowingPercentage: Shows percentage.IsFullWidth:truefor full width,falsefor fixed,nullfor responsive.IsDisabled: Disables styling.Tag: User data.
Remarks:
- Limitation: Values are not clamped, so ensure
Valueis within range.
Example:
<DPProgressBar Label="Upload" Value="75" MaxValue="100" IsShowingPercentage="true" />Animated loading indicator.
Parameters:
Size:LoadingIndicatorSizeenum value.IsLoading: Whenfalse, renders nothing.Tag: User data.
Remarks:
- Warning: Uses static assets under
/_content/ChatAIze.DopamineUI/img.
Example:
<DPLoadingIndicator Size="LoadingIndicatorSize.Medium" />Full-screen loading overlay.
Parameters:
IsVisible: Shows the loading overlay.Tag: User data.
Remarks:
- Warning: Uses static assets under
/_content/ChatAIze.DopamineUI/img.
Example:
<DPLoadingScreen IsVisible="isLoading" />Modal dialog surface built on DPOverlay.
Parameters:
ChildContent: Dialog content.IsOpen: Shows the dialog whentrue.IsDisabled: Disables dialog content.Tag: User data.
Remarks:
- Warning: No focus trap or ESC handling is provided.
Example:
<DPDialog IsOpen="isOpen">
<DPCard>Dialog content</DPCard>
</DPDialog>Save/discard prompt for unsaved changes.
Parameters:
IsVisible: Shows the prompt.IsSavePending: Disables actions and shows loading.IsDisabled: Disables the prompt.SaveClicked: Save callback.DiscardClicked: Discard callback.Tag: User data.
Remarks:
- Warning: Callbacks should handle concurrency and errors explicitly.
Example:
<DPSavePrompt IsVisible="hasChanges" IsSavePending="isSaving" SaveClicked="SaveAsync" DiscardClicked="DiscardAsync" />Simple menu container and items.
Parameters for DPMenu:
ChildContent: Menu items.IsFullWidth:truefor full width,falsefor fit,nullfor responsive.IsOpen: Whether the menu is open.IsOpenChanged: Open state change callback.IsDisabled: Disables the menu.Tag: User data.
Parameters for DPMenuItem:
ChildContent: Item content.IsDisabled: Disables the item.Clicked: Click callback.Tag: User data.
Remarks:
- Tip: Use
@bind-IsOpenfor two-way binding, orDPThreeDotsfor a built-in trigger. - Limitation: No outside click close or keyboard navigation is provided.
Example:
<DPMenu @bind-IsOpen="isOpen">
<DPMenuItem Clicked="EditAsync">Edit</DPMenuItem>
<DPMenuItem Clicked="DeleteAsync">Delete</DPMenuItem>
</DPMenu>Three-dots icon button that toggles a DPMenu internally.
Parameters:
ChildContent: Menu items.IsDisabled: Disables the trigger.Tag: User data.
Remarks:
- Limitation: Open state is internal and not externally controlled.
Example:
<DPThreeDots>
<DPMenuItem Clicked="EditAsync">Edit</DPMenuItem>
<DPMenuItem Clicked="DeleteAsync">Delete</DPMenuItem>
</DPThreeDots>Segmented tab view and tab definition.
Parameters for DPTabView:
ChildContent:DPTabitems.IsFullWidth:truefor full width,falsefor fit,nullfor responsive.IsDisabled: Disables the tab view.Tag: User data.
Parameters for DPTab:
Label: Tab label.ChildContent: Tab content.IsDisabled: Disables the tab.Tag: User data.
Remarks:
- Limitation: Selection state is internal; the first registered tab is selected by default.
Example:
<DPTabView>
<DPTab Label="General">
<DPParagraph>General settings</DPParagraph>
</DPTab>
<DPTab Label="Advanced">
<DPParagraph>Advanced settings</DPParagraph>
</DPTab>
</DPTabView>Responsive navigation layout with side menu and mobile toolbar.
Parameters:
Logo: Logo content.Links: Navigation links.Footer: Footer content.Content: Main page content.Title: Mobile title content.BackUrl: Back navigation path for mobile.IsDisabled: Disables the navigation view.Tag: User data.
Remarks:
- Warning: Mobile menu open state is internal.
Example:
<DPNavigationView>
<Logo>
<DPHeader>Dopamine</DPHeader>
</Logo>
<Links>
<DPNavigationMenuLink Path="/">Home</DPNavigationMenuLink>
<DPNavigationMenuLink Path="/settings">Settings</DPNavigationMenuLink>
</Links>
<Content>
<DPNavigationTitle BackUrl="/">Settings</DPNavigationTitle>
<DPPage Title="Settings">
<DPParagraph>...</DPParagraph>
</DPPage>
</Content>
</DPNavigationView>Registers a title and back link for the active navigation view.
Parameters:
ChildContent: Title content.BackUrl: Back navigation path.Tag: User data.
Remarks:
- Limitation: Does not render any HTML.
Example:
<DPNavigationTitle BackUrl="/">Account</DPNavigationTitle>Navigation button that uses NavigationManager to navigate.
Parameters:
Path: Target URL or route.ChildContent: Link content.IsFullWidth: Makes the link full width whentrue.IsDisabled: Disables navigation.Tag: User data.
Remarks:
- Tip: Use inside
DPNavigationViewto close the mobile menu on navigation. - Limitation: No active state styling is provided.
Example:
<DPNavigationLink Path="/profile" IsFullWidth="true">Profile</DPNavigationLink>Navigation menu link with selected state based on the current route.
Parameters:
Path: Target URL or route.ChildContent: Link content.IsDisabled: Disables navigation.Tag: User data.
Remarks:
- Warning: Overlapping path prefixes can mark multiple links as selected.
Example:
<DPNavigationMenuLink Path="/settings">Settings</DPNavigationMenuLink>Editable list of strings with add and remove controls.
Parameters:
Items: List of values.ItemsChanged: List change callback.ItemPlaceholder: Placeholder for new items.TextFieldType: Input type for each item.ShowItemBorders: Shows card borders around items.MaxItems: Maximum number of items allowed.MaxItemLength: Maximum length per item.AllowDuplicates: Allows duplicate entries whentrue.AddButtonText: Text for the add button.IsLowercase: Normalizes item text to lowercase.IsDisabled: Disables editing.Tag: User data.
Remarks:
- Warning: External changes to
Itemsafter initial render are not reflected unless the component is re-created.
Example:
<DPListEditor Items="tags" ItemsChanged="OnTagsChanged" ItemPlaceholder="Add tag" MaxItems="5" />GPL-3.0-or-later