Aesthetic C# .NET Blazor component library that makes the UI seamless and entertaining to use.
$ dotnet add package ChatAIze.DopamineUIAesthetic C# .NET Blazor component library that makes UI seamless and entertaining to use.
dotnet add package ChatAIze.DopamineUI
Install-Package ChatAIze.DopamineUI
Include 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;
}
}
}
@bind-Value over manual Value and ValueChanged wiring for inputs.IsLoading on interactive components to block multiple submissions and show feedback.DPGroup or DPPage to cascade IsDisabled through a subtree.DPDropDown<T>, , ).DPSegmentedControl<T>DPRadioGroup<T>From/To ranges for DPDatePicker to avoid invalid selections.Tag to attach view models or IDs without rendering them.LoadingIndicatorSize controls DPLoadingIndicator size.ScreenSize provides Tailwind-aligned breakpoints for DPAdaptiveView and DPBreakpoint.TailwindColor is used by DPColorPicker.I1ColumnRepresentable through I5ColumnRepresentable are used by DPTable<T>.ITaggable provides a Tag property 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> and DPNavigationTitle.BackUrl: Back navigation path for DPNavigationTitle.ChildContent: Page content.IsLoading: Shows DPLoadingScreen and disables content.IsDisabled: Disables the page content.Tag: User data.Remarks:
Title for consistent page titles across navigation and browser tabs./_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: true for full width, false for fit, null for 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:
DPGroup to 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:
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:
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:
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:
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:
Example:
<DPHeader>Settings</DPHeader>
Secondary heading (h2).
Parameters:
ChildContent: Subheader text or content.IsDisabled: Disables the subheader styling.Tag: User data.Remarks:
DPHeader.Example:
<DPSubheader>Profile</DPSubheader>
Paragraph text.
Parameters:
ChildContent: Paragraph text or content.IsDisabled: Disables the paragraph styling.Tag: User data.Remarks:
Example:
<DPParagraph>Short helper text.</DPParagraph>
Horizontal divider.
Parameters:
Tag: User data.Remarks:
Example:
<DPDivider />
Styled button with optional loading state and caption.
Parameters:
ChildContent: Button content.Caption: Helper text below the button.Style: ButtonStyle enum value.IsFullWidth: true for full width, false for fit, null for responsive.IsLoading: Shows a loading indicator and disables click.IsDisabled: Disables click and styling.Clicked: Click callback.Tag: User data.Remarks:
/_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: true for full width, false for fit, null for responsive.IsLoading: Shows a loading indicator and disables click.IsDisabled: Disables click and styling.Tag: User data.Remarks:
@bind-Value for two-way binding.InputBase component.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 when true.IsFullWidth: true for full width, false for fit, null for responsive.IsDisabled: Disables input and styling.Tag: User data.Remarks:
InputBase component.Example:
<DPToggleSwitch Label="Airplane mode" @bind-Value="isAirplane" />
Single-line input with optional Enter callback.
Parameters:
Type: TextFieldType enum 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: true for full width, false for fit, null for 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:
InputBase component, so it does not integrate with EditForm validation 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: true for full width, false for fit, null for 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:
InputBase component, so it does not integrate with EditForm validation 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 when true.IsFullWidth: true for full width, false for fit, null for responsive.IsDisabled: Disables input and styling.Tag: User data.Remarks:
InputBase component.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 when true.IsFullWidth: true for full width, false for fit, null for 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:
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: true for full width, false for fit, null for 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:
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: true for full width, false for fit, null for 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:
Equals is stable for custom value types so selection and labels resolve correctly.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: true for full width, false for fit, null for responsive.IsEdited: Shows the edit indicator.IsDisabled: Disables input.Tag: User data.Remarks:
TailwindColor values.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:
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: true for full width, false for fixed, null for responsive.IsEdited: Shows the edit indicator.IsDisabled: Disables input.Tag: User data.Remarks:
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: true for full width, false for fixed, null for responsive.IsEdited: Shows the edit indicator.IsDisabled: Disables input.Tag: User data.Remarks:
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: true for full width, false for fit, null for responsive.IsEdited: Shows the edit indicator.IsLoading: Shows a loading indicator and disables input.IsDisabled: Disables input.Tag: User data.Remarks:
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: true for full width, false for fit, null for responsive.IsEdited: Shows the edit indicator.IsLoading: Shows a loading indicator and disables input.IsDisabled: Disables input.Tag: User data.Remarks:
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 when true.IsFullWidth: true for full width, false for fit, null for responsive.IsEdited: Shows the edit indicator.IsLoading: Shows a loading indicator and disables input.IsDisabled: Disables input.Tag: User data.Remarks:
Example:
<DPTimePicker Label="Time" IsShowingSeconds="true" @bind-Value="time" />
Simple table that renders items implementing column interfaces.
Parameters:
Column1 to Column5: Column headers.Data: Data items to render.IsFullWidth: true for full width, false for fit, null for responsive.IsDisabled: Disables styling.Tag: User data.Remarks:
I1ColumnRepresentable through I5ColumnRepresentable for row data.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: true for full width, false for fixed, null for responsive.IsDisabled: Disables styling.Tag: User data.Remarks:
Value is within range.Example:
<DPProgressBar Label="Upload" Value="75" MaxValue="100" IsShowingPercentage="true" />
Animated loading indicator.
Parameters:
Size: LoadingIndicatorSize enum value.IsLoading: When false, renders nothing.Tag: User data.Remarks:
/_content/ChatAIze.DopamineUI/img.Example:
<DPLoadingIndicator Size="LoadingIndicatorSize.Medium" />
Full-screen loading overlay.
Parameters:
IsVisible: Shows the loading overlay.Tag: User data.Remarks:
/_content/ChatAIze.DopamineUI/img.Example:
<DPLoadingScreen IsVisible="isLoading" />
Modal dialog surface built on DPOverlay.
Parameters:
ChildContent: Dialog content.IsOpen: Shows the dialog when true.IsDisabled: Disables dialog content.Tag: User data.Remarks:
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:
Example:
<DPSavePrompt IsVisible="hasChanges" IsSavePending="isSaving" SaveClicked="SaveAsync" DiscardClicked="DiscardAsync" />
Simple menu container and items.
Parameters for DPMenu:
ChildContent: Menu items.IsFullWidth: true for full width, false for fit, null for 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:
@bind-IsOpen for two-way binding, or DPThreeDots for a built-in trigger.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:
Example:
<DPThreeDots>
<DPMenuItem Clicked="EditAsync">Edit</DPMenuItem>
<DPMenuItem Clicked="DeleteAsync">Delete</DPMenuItem>
</DPThreeDots>
Segmented tab view and tab definition.
Parameters for DPTabView:
ChildContent: DPTab items.IsFullWidth: true for full width, false for fit, null for 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:
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:
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:
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 when true.IsDisabled: Disables navigation.Tag: User data.Remarks:
DPNavigationView to close the mobile menu on navigation.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:
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 when true.AddButtonText: Text for the add button.IsLowercase: Normalizes item text to lowercase.IsDisabled: Disables editing.Tag: User data.Remarks:
Items after 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