UI Kit
- Scope and Setup
- Additional components
- Complete catalog
- Components
- Regenerating Screenshots
- Labels and Validation
- Live Buttons
- Styling
- Complete Example
- Verification
Scope and Setup
DotBlaze.UI is an optional NuGet package containing a component catalog and project-local installation commands. Live stays in core. Without a reference to DotBlaze.UI, dotblaze ui is unknown and does not appear in dotblaze list. After installing/restoring the package and rebuilding, DotBlaze discovers its command automatically. Removing the package and rebuilding removes the command again; previously copied components remain your application's files.
Run from the application's project directory:
dotnet add package DotBlaze.UI
dotblaze ui
dotblaze ui component install
dotblaze ui component list
npm run buildWithout the global CLI, use dotnet run -- ui component install and dotnet run -- ui component add avatar. The dotblaze ui family delegates to the current app, not a globally installed UI catalog. dotblaze ui component also shows component help. All component operations use the component group; the older ui install, ui list, and ui add forms are no longer accepted. The layout and theme command groups are not implemented yet.
| Command | Behavior |
|---|---|
dotblaze ui | Show help and setup instructions; no files are written. |
dotblaze ui component install | Publish shared CSS, all UI scripts and vendor assets, and import ui.css into resources/css/app.css. No component templates are copied. Safe to repeat; existing files are preserved. |
dotblaze ui component list | List the components bundled in the installed version; no network requests or writes. |
dotblaze ui component add <name> | Optional customization: copy a Blade override into resources/views/components/ui/<name>.blade.html. No assets are published. Existing files are skipped, never silently overwritten. |
All 54 component views ship compiled inside the NuGet package. Use <x-ui.button>Save</x-ui.button> immediately without component add; no remote registry is involved. Run component install once for styling and interactive assets. The combobox uses ui-combobox.js; other interactive controls use the shared scripts and bundled vendor libraries. Keep the published vendor LICENSES.txt. Live handles interactive server requests.
Enable the existing component tag helper in _ViewImports.cshtml. The standard app already has @addTagHelper *, DotBlaze and @using DotBlaze. Add @using DotBlaze.UI to _ViewImports.cshtml and place {{ UI.Scripts() }} once in the layout's <head> (@UI.Scripts() in Razor). This loads the installed UI scripts and vendor stylesheets from wwwroot in dependency order. Layouts using Live components also include {{ Live.Scripts() }}. When upgrading an existing layout, remove its manual tags for those UI assets. With the standard Tailwind setup, views under resources/views are already scanned and UI uses plain CSS class names. Custom build setups must include the published stylesheet themselves.
Both Blade and Razor views can use <x-ui.*> tags. In Razor callers, replace Blade {{ expression }} attribute values with @expression. Built-in components update with the package. To customize a template, run dotblaze ui component add button and edit resources/views/components/ui/button.blade.html; local views take priority over package defaults. Customized files and published assets are preserved on upgrades; review and merge them deliberately. Removing a local override and rebuilding restores the package default. UI.Scripts() loads all installed UI assets; it does not perform per-page component detection.
Components
| Component | Behavior |
|---|---|
<x-ui.avatar src="/avatar.jpg" alt="Profile photo" /> | Image avatar; omit src and set initials="AB" for a text fallback. Give informative avatars alt; empty alt means decorative. |
<x-ui.field for="id" label="Name"> | Required for matches its control's id. Optional description and error render associated text. Its slot holds one control. Other attributes (including class) belong to the field wrapper; label-class, description-class, and error-class style those parts. |
<x-ui.input /> | Native input, defaults to type="text". Pass type="email", name, value, required, etc. |
<x-ui.textarea>Text</x-ui.textarea> | Native textarea, defaults to four rows. Initial text is the slot, not a value attribute. |
<x-ui.select>…</x-ui.select> | Native select. Supply option elements in the slot; use selected for server-rendered defaults. |
<x-ui.combobox>…</x-ui.combobox> | Searchable select, single or multiple. Supply option/optgroup elements in the slot like a native select; attributes go to the native select inside. Optional placeholder and empty (no-results text). class styles the outer wrapper (layout/width); control-class, listbox-class, option-class, and chip-class style the parts. Needs ui-combobox.js; without it the native select is shown. |
<x-ui.checkbox /> | Native checkbox. Supply a label through a field or an external <label for>. Pass checked for its initial state. |
<x-ui.button>Save</x-ui.button> | Native button, defaults to type="button". Variants: primary (default), secondary (outlined), filled, ghost, danger. Unknown variants fall back to primary. Sizes: default (40px), size="sm" (32px), size="xs" (24px). |
Controls forward live:*, aria-*, data-*, id, name, and other attributes to the actual control, not a wrapper. Caller classes are appended to the kit class and override it; see Overriding and combining with classes. Boolean expressions behave like native Razor attributes: false/null omit an attribute and true emits it. A literal disabled="false" is still a disabled HTML control; use a boolean expression instead. Minimized disabled and checked are supported.
Text and attribute values are HTML-encoded. Slots accept markup, so do not place untrusted strings into raw/unescaped output.
The screenshots below are generated from the actual sample Blade components in light and dark themes, not mockups. Each <picture> selects the dark image when the browser reports prefers-color-scheme: dark, and otherwise uses the light image. No JavaScript is needed. Documentation renderers must preserve <picture> / <source> for automatic switching; a site-only theme toggle that does not change this media preference will need site-specific integration. Run dotblaze ui component install once, then rebuild CSS/views. The component add commands below are optional: use them only when you want to edit that component's template.
Avatar

dotblaze ui component add avatar<x-ui.avatar initials="AB" alt="Alex Brown" />
<x-ui.avatar initials="CD" alt="Casey Davis" style="--ui-avatar-size: 3.5rem" />
<x-ui.avatar initials="EF" alt="Ellis Ford" style="--ui-avatar-size: 4.5rem" />For a photo, pass src="/images/profile.jpg" and appropriate alt text. Initials are used when src is absent; they are not an automatic fallback for an image URL that fails to load. Use empty alt for a decorative avatar next to the person's name.
Button

dotblaze ui component add button<x-ui.button>Save changes</x-ui.button>
<x-ui.button variant="secondary">Cancel</x-ui.button>
<x-ui.button variant="filled">Filled</x-ui.button>
<x-ui.button variant="ghost">Ghost</x-ui.button>
<x-ui.button variant="danger">Delete</x-ui.button>
<x-ui.button disabled>Disabled</x-ui.button>Use primary sparingly, typically for a form's main submit action. secondary is the outlined neutral button for most other actions, filled is a quieter tinted button, and ghost has no background until hovered (toolbars, inline actions). For compact layouts pass size="sm" or size="xs":
<x-ui.button size="sm" variant="secondary">Edit</x-ui.button>
<x-ui.button size="xs" variant="ghost">Copy</x-ui.button>Buttons default to type="button"; use type="submit" inside a form. See Live Buttons for loading text and action bindings.
Field

dotblaze ui component add field
dotblaze ui component add input<x-ui.field for="profile-name" label="Display name"
description="Visible on your public profile."
error="Please enter your name.">
<x-ui.input id="profile-name" placeholder="Your name"
aria-invalid="true"
aria-describedby="profile-name-description profile-name-error" />
</x-ui.field>The field is a wrapper, not an input. Place any built-in control in its slot; no separate installation is needed. The static error above demonstrates its appearance; real forms should pass the current validation error as shown in Labels and Validation.
Input

dotblaze ui component add input<label for="email">Email address</label>
<x-ui.input id="email" name="Email" type="email" placeholder="you@example.com" />Use a visible label, not only a placeholder. Native attributes such as required, autocomplete, disabled, and maxlength are forwarded to the input.
Textarea

dotblaze ui component add textarea<label for="bio">Biography</label>
<x-ui.textarea id="bio" name="Bio" rows="3"
placeholder="Tell us a little about yourself.">I enjoy building useful things.</x-ui.textarea>Initial content belongs in the slot, not a value attribute. For Live, add live:model="Bio".
Select

dotblaze ui component add select<label for="visibility">Profile visibility</label>
<x-ui.select id="visibility" name="Visibility">
<option value="public">Public — visible to everyone</option>
<option value="private">Private — only you</option>
</x-ui.select>This is a native select, not a JavaScript dropdown. The kit replaces only the closed control's arrow with its own chevron (the native arrow returns in forced-colors/high-contrast mode). The closed control is pictured; the expanded option menu follows the browser/operating system. Use selected for a server-rendered default or live:model for Live binding.
Combobox (searchable select)

dotblaze ui component add comboboxThis copies resources/views/components/ui/combobox.blade.html and wwwroot/js/ui-combobox.js. {{ UI.Scripts() }} loads the script from wwwroot. The script enhances comboboxes when they appear on the page.
<label for="country">Country</label>
<x-ui.combobox id="country" name="Country" placeholder="Select a country…">
<option value="">Select a country…</option>
<option value="id" selected>Indonesia</option>
<option value="jp">Japan</option>
<option value="nl">Netherlands</option>
</x-ui.combobox>
<label for="languages">Languages</label>
<x-ui.combobox id="languages" name="Languages" multiple placeholder="Search languages…" empty="No languages found">
<optgroup label="Southeast Asia">
<option value="id" selected>Indonesian</option>
<option value="jv">Javanese</option>
</optgroup>
<optgroup label="Other">
<option value="en" selected>English</option>
<option value="ja">Japanese</option>
</optgroup>
</x-ui.combobox>How it works. The component renders an ordinary <select> (with your id, name, multiple, live:model, required, aria-*, …) plus an empty container. The script hides the select visually and builds a search input and option list next to it. The native select remains the source of truth: choosing an option sets option.selected and fires input/change on the select, so form posts, live:model, and server-rendered selected behave exactly as for <x-ui.select>. Without the script (or with JavaScript disabled) the native select is used as is, so the form still works.
- Search filters the rendered options by text, case- and accent-insensitive (
indomatches "Indonesia"). Optgroup labels stay above their matching options.emptysets the text shown when nothing matches (default "No results"). - Single: the closed control shows the selected option's text. Opening it clears the text for searching and shows the current value as a hint; Escape or leaving the field restores it. An option with
value=""acts as "nothing selected" and its text is the default placeholder. - Multiple: selected options appear as chips with remove buttons; the list stays open while you toggle options (checked options show a check mark). Options with
value=""are not listed. - Keyboard: ↓/↑ open the list and move, Home/End jump to the first/last option while open, Enter selects (and does not submit the form while the list is open), Esc closes, Tab closes without selecting, and in a multiple combobox Backspace in an empty search removes the last chip. Disabled options are skipped.
- Accessibility: it follows the WAI-ARIA combobox pattern (
role="combobox"input witharia-expanded,aria-controls,aria-activedescendant;role="listbox"witharia-selectedoptions andaria-multiselectablefor multiple). The<label for>,aria-describedby,aria-invalid,required, anddisabledof the select are mirrored onto the search input, and clicking the label focuses the search. A "no results" message is announced through a status region.
With Live, bind the select as usual. A multiple select binds to a list:
<x-ui.field for="ui-languages" label="Languages" error="{{ Model.Error("Languages") }}">
<x-ui.combobox id="ui-languages" name="Languages" multiple live:model="Languages" placeholder="Search languages…"
aria-invalid="{{ Model.Error("Languages") is null ? "false" : "true" }}"
aria-describedby="{{ Model.Error("Languages") is null ? null : "ui-languages-error" }}">
@foreach (var (code, language) in UiForm.LanguageNames)
<option value="{{ code }}" selected="{{ Model.Languages.Contains(code) }}">{{ language }}</option>
@endforeach
</x-ui.combobox>
</x-ui.field>public List<string> Languages { get; set; } = [];The enhanced UI is marked live:ignore and survives re-renders, including while it is open and focused; after each update it re-reads the select, so server-side changes to options, selection, and validation state appear immediately. Comboboxes added later (Live navigation, lazy components) are enhanced automatically; call DotBlazeCombobox.enhance(element) for markup you insert yourself. Always validate the submitted values on the server: the list only offers choices.
Limits of this version: filtering is done in the browser over the options already rendered, so it suits lists up to a few hundred items; there is no server-side search, free-text entry, or creating new options yet. The option list opens below the control and can be clipped by an ancestor with overflow: hidden.
Checkbox

dotblaze ui component add checkbox<label><x-ui.checkbox name="EmailNotifications" checked /> Email notifications</label>
<label><x-ui.checkbox name="ProductUpdates" /> Product updates</label>
<label><x-ui.checkbox disabled /> Unavailable option</label>The checkbox is still a native <input type="checkbox"> (keyboard, form submission, and live:model are unchanged); only its box and check mark are drawn by CSS using the accent color. In forced-colors/high-contrast mode the browser's native checkbox is used.
The wrapping label supplies an accessible name and a larger click target. You can instead use an explicit id and <label for="...">. The screenshots include demo spacing; add your own layout classes when placing components together.
Additional components
These use native HTML and need no additional JavaScript. They are DotBlaze implementations, not a claim of full Flux API compatibility. Upgrade/merge published ui.css when adding newly released components: install deliberately does not overwrite existing CSS.
Accordion

dotblaze ui component add accordion<x-ui.accordion heading="Can I customize components?" name="catalog-faq" open>Yes. Published Blade files belong to your application.</x-ui.accordion>
<x-ui.accordion heading="Does this need JavaScript?" name="catalog-faq">No. This uses native HTML details and summary.</x-ui.accordion>One disclosure per tag. Required heading; native open expands it initially. Give siblings the same name for exclusive opening in supporting browsers. Space/Enter toggle the focused summary. No special disabled or transition prop, nested heading slots, or custom find-in-page behavior is promised: this follows native details/summary behavior.
Badge

dotblaze ui component add badge<div class="flex gap-3"><x-ui.badge>Draft</x-ui.badge><x-ui.badge variant="success">Published</x-ui.badge><x-ui.badge variant="warning">Pending</x-ui.badge><x-ui.badge variant="danger">Failed</x-ui.badge></div>Variants: neutral (default), success, warning, danger. Unknown variants fall back to neutral. Keep meaningful status text instead of relying only on color.
Breadcrumbs

dotblaze ui component add breadcrumbs<x-ui.breadcrumbs><li><a href="/">Home</a></li><li><a href="/ui">Components</a></li><li aria-current="page">Settings</li></x-ui.breadcrumbs>Supply ordered <li> children and aria-current="page" on the current item. Default landmark label is Breadcrumb; override aria-label when several trails exist.
Callout

dotblaze ui component add callout<x-ui.callout heading="Your changes are saved">Continue editing or return to your dashboard.</x-ui.callout>Optional heading, neutral or danger variant. Static callouts do not announce automatically. Explicitly use role="alert" for dynamically inserted urgent content, or role="status" for non-urgent updates.
Card

dotblaze ui component add card<x-ui.card><h3 class="font-semibold mb-2">Project settings</h3><p>Manage the details of your workspace.</p></x-ui.card>An ordinary div container with padding and a slot. Supply your own headings, controls and spacing. Utilities override default styling.
Heading

dotblaze ui component add heading<x-ui.heading level="2">Build something useful</x-ui.heading>level selects a real h1–h6 element (default 2). Invalid levels fail rendering. Use levels for document structure and utility classes for visual size.
Progress

dotblaze ui component add progress<label for="catalog-progress" class="ui-label mb-3 block">Upload progress: 65%</label><x-ui.progress id="catalog-progress" value="65" max="100">65%</x-ui.progress>Native progress element, default max 100. Supply value for determinate progress; omit it for native indeterminate progress. Supply a label or aria-label. No upload tracking/polling is added automatically; indeterminate styling follows the browser.
Radio

dotblaze ui component add radio<fieldset class="grid gap-3"><legend class="ui-label mb-3">Delivery method</legend><label class="flex gap-3 items-center"><x-ui.radio name="delivery" value="email" checked /> Email</label><label class="flex gap-3 items-center"><x-ui.radio name="delivery" value="sms" /> SMS</label><label class="flex gap-3 items-center"><x-ui.radio name="delivery" value="post" disabled /> Post (unavailable)</label></fieldset>Native radio input. Same name groups options; values identify choices. Label each input and use a fieldset/legend for the group. live:model="Delivery" binds a string property. Arrow keys and disabled states retain native behavior.
Separator

dotblaze ui component add separator<p>Account details</p><x-ui.separator /><p>Notification preferences</p>Native horizontal thematic break (hr). Use a CSS border instead when the separator is purely decorative.
Skeleton

dotblaze ui component add skeleton<div aria-busy="true" aria-label="Loading profile" class="grid gap-3"><x-ui.skeleton class="w-1/3 h-5" /><x-ui.skeleton /><x-ui.skeleton class="w-2/3" /></div>Static decorative placeholder, hidden from assistive technology. Size through classes/style; give the loading region an accessible name and aria-busy. No animation or fake content is generated.
Slider

dotblaze ui component add slider<label for="catalog-volume" class="ui-label mb-3 block">Volume</label><x-ui.slider id="catalog-volume" name="volume" min="0" max="100" step="5" value="50" />Native range input; min/max/step/value are forwarded. Use a label and live:model.change="Volume" for Live numeric state. Keyboard changes/clamping follow browser semantics; validate values on the server too.
Switch

dotblaze ui component add switch<div class="grid gap-4"><label class="flex gap-3 items-center"><x-ui.switch name="notifications" checked /> Notifications</label><label class="flex gap-3 items-center"><x-ui.switch name="marketing" /> Marketing emails</label><label class="flex gap-3 items-center"><x-ui.switch disabled /> Unavailable</label></div>Native checkbox with role=switch. live:model="Notifications" binds a boolean. Label it. checked/disabled/required/name/value retain native semantics; unchecked ordinary POST fields are omitted.
Text

dotblaze ui component add text<x-ui.text>A readable paragraph using the muted theme color and comfortable line height.</x-ui.text>A paragraph with muted theme color. Slots can contain markup; use encoded Blade expressions for user content.
Toggle

dotblaze ui component add toggle<div class="flex gap-3"><x-ui.toggle name="bold" label="Bold" checked /><x-ui.toggle name="italic" label="Italic" /><x-ui.toggle label="Locked" disabled /></div>Required encoded label. A native checkbox styled as a selectable button, with checkbox semantics rather than aria-pressed. Space toggles it; attributes/classes target the input. Bind a boolean with live:model. Disabled controls remain non-interactive.
Complete catalog
Components marked Script required use assets provided by ui component install; UI.Scripts() loads them from wwwroot. Native components need no script. The editor, chart, calendar, date/time, and kanban widgets use bundled vendor libraries and ui-widgets.js. No component add is needed. Merge changes to published CSS and JavaScript when upgrading.
Autocomplete

dotblaze ui component add autocomplete<label for="catalog-autocomplete">City</label>
<x-ui.autocomplete id="catalog-autocomplete" name="city" placeholder="Type a city"><option value="Jakarta" /><option value="Bandung" /><option value="Surabaya" /></x-ui.autocomplete>Native datalist suggestions, not a constrained select. Requires unique id. Arbitrary text is allowed; validate server-side. Browser/OS controls the suggestion popup. Supports live:model on the input.
Date Picker

dotblaze ui component add date-picker<label for="catalog-date-picker">Date Picker</label>
<x-ui.date-picker id="catalog-date-picker" name="date-picker" />Flatpickr custom date picker (not the browser-native popup, including on mobile). value/min/max use YYYY-MM-DD. Text entry and keyboard calendar navigation are supported. Attributes and live:model bind the text input. Requires the local Flatpickr and widget assets listed below.
Datetime Picker

dotblaze ui component add datetime-picker<label for="catalog-datetime-picker">Datetime Picker</label>
<x-ui.datetime-picker id="catalog-datetime-picker" name="datetime-picker" />Flatpickr custom calendar plus 24-hour time controls. value/min/max use YYYY-MM-DDTHH:mm; minute-step defaults to 1. No timezone conversion: interpret local time explicitly on the server. Input is text, not datetime-local. Requires Flatpickr and widget assets.
Time Picker

dotblaze ui component add time-picker<label for="catalog-time-picker">Time Picker</label>
<x-ui.time-picker id="catalog-time-picker" name="time-picker" />Flatpickr custom 24-hour time picker without a calendar. value/min/max use HH:mm; use minute-step for increments (1–60). Works consistently on mobile with native delegation disabled. Requires Flatpickr and widget assets.
Color Picker

dotblaze ui component add color-picker<label for="catalog-color-picker">Color Picker</label>
<x-ui.color-picker id="catalog-color-picker" name="color-picker" />Native single-color chooser; use a six-digit hex value. Alpha/gradient controls are not provided. Attributes and live:model go to the input.
Phone

dotblaze ui component add phone<label for="catalog-phone">Phone</label>
<x-ui.phone id="catalog-phone" name="phone" />Native tel input with browser autofill support. No automatic country parsing or phone validity claim; supply autocomplete="tel" and server-side validation. Attributes and live:model go to the input.
Otp Input

dotblaze ui component add otp-input<label for="catalog-otp">Verification code</label><x-ui.otp-input id="catalog-otp" name="code" length="6" placeholder="000000" />Single accessible text field with numeric keyboard, one-time-code autofill and length/pattern constraints. Paste and leading zeroes are preserved. Browser constraints do not replace verification/rate-limiting on the server.
File Upload

dotblaze ui component add file-upload<label for="catalog-file">Attach files</label><x-ui.file-upload id="catalog-file" name="files" multiple />Native file chooser; accept/multiple/disabled are forwarded. In a Live component use live:model on a LiveFile property as documented in Live uploads. Ordinary forms need multipart/form-data; enforce size, type and authorization server-side.
Brand

dotblaze ui component add brand<x-ui.brand name="Acme"><span aria-hidden="true">◆</span></x-ui.brand>Brand name with an optional logo slot. Wrap in an anchor to link home. Logo markup is developer-owned; mark a redundant logo decorative.
Flag

dotblaze ui component add flag<x-ui.flag country="ID" label="Indonesia" /> <x-ui.flag country="JP" label="Japan" />Unicode regional-indicator flag for a two-letter code, with required label. OS/font determines artwork; some platforms show letters instead of a flag. This does not validate geopolitical recognition or provide language selection.
Icon

dotblaze ui component add icon<div class="flex gap-5"><x-ui.icon name="check" label="Complete" /><x-ui.icon name="search" label="Search" /><x-ui.icon name="plus" label="Add" /><x-ui.icon name="menu" label="Menu" /></div>Six original inline stroke icons: check, close, plus, search, chevron-down, menu. Unknown names fail rendering. Decorative by default; provide label for meaningful standalone icons. No external icon package.
Item

dotblaze ui component add item<x-ui.item><span>Project proposal</span><small>Updated today</small></x-ui.item>Flexible content row. Slot may contain links, controls, and text; the wrapper does not pretend to be a button or selection control.
Navbar

dotblaze ui component add navbar<x-ui.navbar><a href="/">Home</a><a href="/ui" aria-current="page">Components</a><a href="#verification">Guide</a></x-ui.navbar>Responsive wrapping navigation landmark. Supply links and aria-current; no hidden mobile menu or automatic routing. Use live:navigate on links when wanted.
Profile

dotblaze ui component add profile<x-ui.profile name="Alex Morgan" description="Product designer"><span class="ui-avatar" aria-hidden="true">AM</span></x-ui.profile>Name and description with an optional avatar slot. Text is encoded. It is not a dropdown; wrap or compose with other controls deliberately.
Table

dotblaze ui component add table<x-ui.table label="Projects"><caption>Current projects</caption><thead><tr><th scope="col">Project</th><th scope="col">Status</th></tr></thead><tbody><tr><th scope="row">Website</th><td>In progress</td></tr><tr><th scope="row">Mobile app</th><td>Planned</td></tr></tbody></x-ui.table>Scrollable semantic table. Supply caption, th/scope, thead/tbody in its slot. No fabricated sorting/filtering: use server queries/Live actions when those are needed. Keyboard-focusable region allows horizontal scrolling.
Timeline

dotblaze ui component add timeline<x-ui.timeline aria-label="Order history"><li><time datetime="2026-01-10">Jan 10</time><strong>Order received</strong><p>Your order is being prepared.</p></li><li><time datetime="2026-01-11">Jan 11</time><strong>Dispatched</strong><p>On its way.</p></li></x-ui.timeline>Ordered chronological list. Supply li items, real time/datetime values, and readable event labels. No implicit time sorting.
Pagination

dotblaze ui component add pagination<x-ui.pagination page="2" pages="8" url="?page={page}" />Previous/next links with current and total page counts. page/pages must be valid positive integers. The developer-supplied URL template contains {page}; preserve filters/URL encoding yourself. Not tied to one model/query and not a Live action paginator.
Dropdown

dotblaze ui component add dropdownScript required.
<x-ui.dropdown label="Actions"><a href="#components">View components</a><button type="button">Duplicate</button></x-ui.dropdown>Native disclosure containing links/buttons. Enter/Space toggle; Escape and outside-click close with the published script. Uses normal Tab order rather than claiming ARIA menu semantics.
Modal

dotblaze ui component add modalScript required.
<button type="button" class="ui-button ui-button-secondary" data-ui-open="catalog-modal">Open dialog</button><x-ui.modal id="catalog-modal" title="Edit profile"><label for="modal-name">Profile name</label><input id="modal-name" class="ui-control" value="Alex" /><button type="button" class="ui-button ui-button-primary mt-4" data-ui-close>Done</button></x-ui.modal>Native modal dialog, opened by data-ui-open="id" and closed by data-ui-close or Escape. Native modal focus containment plus focus restoration to opener; give a unique id/title. No nested forms injected. Modern dialog support required.
Popover

dotblaze ui component add popover<button type="button" class="ui-button ui-button-secondary" popovertarget="catalog-popover">Show details</button><x-ui.popover id="catalog-popover"><strong>Project info</strong><p>Shared with your team.</p></x-ui.popover>Native Popover API with outside-click and Escape dismissal; trigger uses popovertarget. Not modal and does not trap focus. CSS anchor positioning places the panel below its trigger, follows scrolling, and flips near viewport edges. Browsers without CSS anchor positioning retain the centered fallback. Modern popover support required.
Tooltip

dotblaze ui component add tooltipScript required.
<x-ui.tooltip text="Available to everyone"><span>Public visibility ⓘ</span></x-ui.tooltip>Focus/hover reveals plain tooltip text; Escape suppresses it until focus/hover leaves. Wrapper is the focusable trigger: use non-interactive slot content, not nested buttons/links. Tooltip must not contain essential-only information.
Tabs

dotblaze ui component add tabsScript required.
<x-ui.tabs><div role="tablist" aria-label="Project details"><button type="button" role="tab" id="catalog-tab-overview" aria-controls="catalog-panel-overview" aria-selected="true">Overview</button><button type="button" role="tab" id="catalog-tab-settings" aria-controls="catalog-panel-settings" aria-selected="false">Settings</button></div><section role="tabpanel" id="catalog-panel-overview" aria-labelledby="catalog-tab-overview">Project overview</section><section role="tabpanel" id="catalog-panel-settings" aria-labelledby="catalog-tab-settings" hidden>Project settings</section></x-ui.tabs>Slot contains tablist/buttons and associated panels with unique IDs. Script manages selection, hidden state, roving tabindex, ArrowLeft/Right and Home/End (Up/Down for aria-orientation=vertical). Buttons may be disabled. No remote loading.
Toast

dotblaze ui component add toastScript required.
<button type="button" class="ui-button ui-button-secondary" data-ui-toast-show="catalog-toast">Save changes</button><x-ui.toast id="catalog-toast">Changes saved.</x-ui.toast>Show using data-ui-toast-show="id" or DotBlazeUI.toast(id, text). The status region announces politely and stays visible until dismissed; no timer surprise. JS text uses textContent. Container must exist before announcing.
Command

dotblaze ui component add commandScript required.
<x-ui.command label="Find an action"><button type="button" data-ui-command-item>New project</button><button type="button" data-ui-command-item>Open settings</button><a href="#components" data-ui-command-item>Browse components</a></x-ui.command>Filters direct marked buttons/links by text. ArrowDown/Up navigate enabled visible results, Enter activates, Escape clears search. Native buttons/links retain roles; no pretend combobox ARIA. Wrap in modal for a command palette.
Context

dotblaze ui component add contextScript required.
<x-ui.context id="catalog-context" label="Project file"><button type="button">Rename</button><button type="button">Download</button></x-ui.context>Right-click, Shift+F10/ContextMenu key, or visible Actions button opens local actions. Escape/outside-click closes and returns focus. Normal Tab order, no global menu interception; supports touch via explicit button.
Carousel

dotblaze ui component add carouselScript required.
<x-ui.carousel label="Highlights"><article><h3>First highlight</h3><p>Build reusable interfaces.</p></article><article><h3>Second highlight</h3><p>Keep your source editable.</p></article><article><h3>Third highlight</h3><p>Use native accessibility.</p></article></x-ui.carousel>Each direct slot child is a slide. Previous/next controls wrap; hidden slides leave the tab order. Announces current position. No autoplay, drag gestures, or remote media loading.
Calendar

dotblaze ui component add calendarScript required.
<label for="catalog-calendar">Appointment date</label><x-ui.calendar id="catalog-calendar" name="date" value="2026-06-15" min="2026-06-01" max="2026-08-31" />Inline Flatpickr calendar with month/year navigation, keyboard selection, and a text field. Uses local YYYY-MM-DD dates (no UTC conversion), honors min/max/disabled/readonly, and binds live:model. The built-in picker is used even on mobile. Single-date selection; range/multiple modes are not exposed by this wrapper.
Pillbox

dotblaze ui component add pillboxScript required.
<label for="catalog-pillbox">Tags</label><x-ui.pillbox id="catalog-pillbox" name="tags" placeholder="Add a tag"><option selected value="design">design</option><option selected value="backend">backend</option></x-ui.pillbox>Editable text chips backed by a multiple select. Enter/Add creates a unique trimmed tag; remove buttons deselect it. Existing unselected options remain available. disabled/readonly prevent changes. JS emits native input/change for Live array binding. Validate allowed tags and count on the server.
Editor

dotblaze ui component add editorScript required.
<label for="catalog-editor">Article</label>
<x-ui.editor id="catalog-editor" name="content">{{ "## Your story\n\nWrite something **useful** here." }}</x-ui.editor>Quill 2 WYSIWYG editor whose input, form submission, and live:model value are Markdown strings, not HTML. Marked parses Markdown for visual editing; DOMPurify filters that internal HTML; Turndown serializes edits back to Markdown. Supports headings 1–3, bold, italic, strikethrough (~~text~~), ordered/bullet lists, blockquotes, fenced code blocks, links and clear formatting. Underline is not offered because standard Markdown has no underline syntax. Images, tables, embeds and arbitrary HTML formatting are not supported by this editor; do not use it for lossless editing of those constructs. Code-fence language metadata and whitespace/list-marker choices may normalize on edit; untouched values are not rewritten. Required/disabled/readonly and error attributes are synchronized, and toolbar buttons have accessible labels. Markdown is still untrusted input: validate it server-side and sanitize/disable raw HTML when converting it to HTML for display. Client filtering is not an authorization or server-side sanitization boundary.
Composer

dotblaze ui component add composerScript required.
<form data-catalog-composer><x-ui.composer id="catalog-composer" name="message" placeholder="Write a message…" required /></form>Message composer for a surrounding form. Submit button and Ctrl/Meta+Enter use native requestSubmit/validation, so a Live form works normally. Plain Enter inserts a newline. No auto-send endpoint, attachments, storage, or AI behavior. Supply authorization/CSRF/backend yourself.
Kanban

dotblaze ui component add kanbanScript required.
<x-ui.kanban id="catalog-kanban" name="board"><section data-ui-column="todo" aria-label="To do"><h3>To do</h3><article data-ui-card="draft"><span>Write draft</span></article></section><section data-ui-column="done" aria-label="Done"><h3>Done</h3><article data-ui-card="research"><span>Research</span></article></section></x-ui.kanban>SortableJS provides pointer/touch drag handles, cross-column movement and ordering within a column. Columns use unique data-ui-column IDs and direct article children use unique data-ui-card IDs. Dragging cannot transfer cards between separate board instances. Previous/next-column and up/down buttons remain available for keyboard users. The hidden field serializes JSON {column:[cardIds]} and emits input/change plus ui:kanban-change for both pointer and keyboard moves. live:model binds a JSON string. Validate card membership, order and ownership server-side. Server-rendered column/card markup remains authoritative on rerender.
Chart

dotblaze ui component add chartScript required.
<x-ui.chart label="Orders by month" type="line"><caption>Monthly orders</caption><thead><tr><th scope="col">Month</th><th scope="col">Online</th><th scope="col">Store</th></tr></thead><tbody><tr><th scope="row">January</th><td>24</td><td>18</td></tr><tr><th scope="row">February</th><td>38</td><td>23</td></tr><tr><th scope="row">March</th><td>31</td><td>29</td></tr></tbody></x-ui.chart>Chart.js chart generated from a semantic table: first header/cell is the category, subsequent headers name 1–4 numeric series. type="line" or type="bar" (default), optional stacked. Negative values are supported on one zero-based value scale; no dual axes. Multiple series have a legend, distinct point/dash encodings, and direct endpoint labels for lines. Hover tooltips and the full data table provide exact values. A validated light/dark palette retains colors by series name during updates (maximum four distinct identities per instance, never recycled). Invalid/ragged/nonfinite data displays an error and reveals the table. Different units should use separate charts. Tables remain necessary for screen readers and print/forced-colors use.
Bundled advanced widgets
ui component install publishes all widget vendor assets. UI.Scripts() loads the installed assets automatically; ui component add only copies a template override. The pinned libraries are served locally and carry redistribution notices in wwwroot/vendor/ui/LICENSES.txt. Use your usual CSS build for the shared component stylesheet.
| Component | Local dependencies, in load order |
|---|---|
| editor | purify.js (DOMPurify 3.5.0), marked.js (18.3.0), turndown.js (7.2.5), quill.js / quill.css (Quill 2.0.2), ui-widgets.js |
| chart | chart.js (Chart.js 4.6.2), ui-widgets.js |
| calendar, date-picker, datetime-picker, time-picker | flatpickr.js / flatpickr.css (4.6.13), ui-widgets.js |
| kanban | ui-components.js, sortable.js (SortableJS 1.15.7), ui-widgets.js |
The existing ui.css contains theme overrides for both modes. Widget-generated DOM is isolated with live:ignore; backing form values remain part of normal Live updates. Adapters synchronize new server values and release instances/popups on removal or navigation. Do not put live:ignore on the whole form/control wrapper, which would prevent server state updates.
Upgrade note: the editor retains Markdown values while providing a WYSIWYG interface; date/time inputs become text fields containing the same ISO-format values; chart tables now require a header for each series. Existing published CSS, scripts, and templates are not automatically overwritten. Merge the updated files together, including vendor assets, to avoid mixing old and new protocols.
For framework maintainers, reproduce the vendored assets with:
cd src/DotBlaze.UI
npm ci --ignore-scripts
npm run buildThe checked-in lockfile records integrity hashes. build-assets.cjs copies browser distributions and licenses to package/sample assets. DOMPurify, Quill and their bundled dependencies require ongoing security updates; retain notices when redistributing.
Regenerating Screenshots
From the repository root, install the sample build tools and browser dependencies once:
npm --prefix samples/SampleApp install
npm --prefix tests/Browser install
cd tests/Browser
npx playwright install chromium
cd ../..Then regenerate all 108 images (54 components × two themes):
npm --prefix tests/Browser run screenshots:uiThe script builds the sample CSS and .NET app, migrates an isolated temporary SQLite database, starts the sample on an available loopback port, and captures each [data-ui-preview] section from /ui (the combobox is captured open, filtered by a search). It stops the server in cleanup. It does not migrate or write the application's normal database/storage. Temporary run files and logs remain under the printed system-temp path for troubleshooting.
Images are written to docs/images/ui/<component>.png (light fallback) and <component>-dark.png, overwriting previously generated images. The script captures both browser color schemes and applies the matching .dark class to the sample; preview cards and native controls use the same theme. Dark defaults use neutral zinc (#18181b). The sample bundles the Inter variable font (copied from @fontsource-variable/inter by npm run build), so screenshots do not depend on the operating system's default sans-serif font. Areas outside the rounded cards are transparent, and the script checks the PNG corner alpha values so no white corners are baked into either theme. The viewport, locale, and device scale are fixed; animations are disabled and fonts/images are awaited. Browser text-rendering differences between operating systems may still affect individual pixels. The script checks that the expected components rendered, UI CSS loaded with matching card/background colors, and no browser errors occurred. It also loads the actual <picture> snippets from this document and verifies that all 54 selected images switch dark → light → dark without a page reload.
To reuse an already running SampleApp, set BASE_URL to its origin before running the command. In this mode the script does not build, migrate, or stop that server; ensure its assets are current. When updating a component, regenerate and review its screenshot alongside the documentation changes.
Labels and Validation
Fields deliberately do not rewrite their child markup. Supply the same stable, page-unique id in for and on the control, and explicitly associate descriptions and errors:
{{-- Inside a Live view whose model has DisplayName and validation rules. --}}
<x-ui.field for="profile-name" label="Name"
description="Your public name." error="{{ Model.Error("DisplayName") }}">
<x-ui.input id="profile-name" name="DisplayName" live:model.blur="DisplayName"
value="{{ Model.DisplayName }}"
aria-invalid="{{ Model.Error("DisplayName") is null ? "false" : "true" }}"
aria-describedby="{{ Model.Error("DisplayName") is null ? "profile-name-description" : "profile-name-description profile-name-error" }}" />
</x-ui.field>A description has id {for}-description; an error has id {for}-error and role="alert". Only reference an error id when that error exists. With no description or error, omit aria-describedby. Pass lowercase strings "true" / "false" for ARIA state values, not C# booleans (which follow HTML boolean-attribute rules).
Validation still belongs to the Live component or request validator. The UI kit does not validate, persist data, sanitize server input, or replace authorization/CSRF protection. required and maxlength provide browser hints, not a server trust boundary. An unchecked native checkbox is omitted from an ordinary form POST; Live handles boolean binding directly.
Live Buttons
<form live:submit="Save">
{{-- Fields go here. --}}
<x-ui.button type="submit" loading="Saving…" live:target="Save">Save</x-ui.button>
</form>loading is optional text shown during a matching Live request, using the existing live:loading.inline directive and a status region. live:target applies to both the regular and loading labels. Without a target, any request on the owning Live component shows loading. Live automatically disables form buttons while submitting, preserving buttons that were already disabled. Browsers can move focus away from a disabled submit button; this kit does not restore button focus after submission. Text-control focus is preserved across the tested validation updates.
For a standalone action, request disabling explicitly:
<x-ui.button live:click="Save" live:target="Save"
live:loading.attr="disabled" loading="Saving…">Save</x-ui.button>Keep a permanently disabled action as a plain disabled button without a loading attribute directive. Loading behavior requires a containing Live component and Live scripts. Ordinary form buttons should omit loading and set type="submit"; remember @csrf on POST forms. The existing SampleApp post form demonstrates ordinary POST fallback alongside Live submission.
Styling
Overriding and combining with classes
Every rule in ui.css lives in the CSS cascade layer components. Tailwind v4 puts its utilities in the later utilities layer, and any CSS of yours that is not in a layer comes after both, so a class you pass always wins over the kit's own style, regardless of selector specificity, including hover, dark-mode, and variant rules. You do not need !important or Tailwind's ! prefix.
{{-- Combine: keep the variant and size, change only what you name. --}}
<x-ui.button class="rounded-full bg-emerald-600 px-6 text-white hover:bg-emerald-700">Rounded emerald</x-ui.button>
<x-ui.button variant="secondary" size="sm" class="border-dashed">Dashed small</x-ui.button>
<x-ui.input id="search" class="h-12 rounded-full px-5" placeholder="Search…" />
<x-ui.checkbox class="size-6 rounded-full checked:border-emerald-600 checked:bg-emerald-600" />
<x-ui.avatar initials="TW" class="rounded-lg bg-emerald-600 text-white" />class goes to the element the component renders: the button, input, textarea, select, checkbox, or avatar. Components with several parts accept a class attribute per part:
| Component | class goes to | Part attributes |
|---|---|---|
<x-ui.field> | the wrapper div | label-class, description-class, error-class |
<x-ui.combobox> | the outer wrapper (set width/margins here; the list matches its width) | control-class (the visible control, and the native select used without JavaScript), listbox-class, option-class, chip-class |
<x-ui.field for="search" label="Search" label-class="text-xs uppercase tracking-wide" error-class="font-normal">
<x-ui.input id="search" />
</x-ui.field>
<x-ui.combobox id="tags" name="Tags" multiple class="max-w-sm" control-class="rounded-2xl"
listbox-class="rounded-2xl" option-class="rounded-xl" chip-class="rounded-full bg-emerald-100 text-emerald-800">
…
</x-ui.combobox>The kit classes are public too, so you can apply them to plain elements, for example a link that looks like a button: <a href="/docs" class="ui-button ui-button-ghost">Docs</a>. The available classes are ui-button with ui-button-primary|secondary|filled|ghost|danger and ui-button-sm|xs, ui-control (input, textarea, select), ui-checkbox, ui-avatar, ui-field, ui-label, ui-description, and ui-error.
Classes change one element; to restyle the whole kit consistently, change the theme tokens instead. Two notes:
- Utility classes must appear in files Tailwind scans. Classes written in your views (including part attributes) are found by the standard
@source "../views"; classes built at runtime from strings are not. - Plain CSS overrides work the same way: an unlayered rule such as
.ui-button { border-radius: 9999px; }in yourapp.cssoverrides the kit. If you put your own CSS in a layer, declare it aftercomponents(for example inutilities). An app that copiedui.cssbefore this change has unlayered kit rules, so utilities do not override them; republish or wrap that file's rules in@layer components { … }.
Theme tokens
The default look is a neutral zinc palette: 40px controls, 14px text, 8px radius, light borders with a slightly stronger bottom edge and a subtle shadow, and a dark primary button (white in dark mode). The kit inherits your page font; it looks best with a modern sans-serif such as Inter, which the sample uses. The stylesheet includes focus outlines, disabled states, and invalid-control borders. Override CSS custom properties on :root or a containing element (in unlayered CSS, or any layer after components):
.profile-form {
--ui-accent: #0f766e;
--ui-radius: 0.75rem;
--ui-space: 0.5rem;
}Tokens are --ui-accent, --ui-accent-content, --ui-accent-foreground, --ui-danger, --ui-danger-foreground, --ui-surface, --ui-control (input/checkbox/outlined-button background), --ui-text, --ui-muted, --ui-border, --ui-border-strong (control bottom edge and checkbox border), --ui-filled / --ui-filled-hover (tinted backgrounds), --ui-ring (focus outline, defaults to the accent), --ui-shadow, --ui-radius, --ui-space, --ui-height (control and button height), and --ui-avatar-size. The checkbox check mark (--ui-check) and select chevron (--ui-chevron) are SVG data URLs; if you change --ui-accent-foreground, override --ui-check with a matching stroke color. --ui-accent-content is available for your own accent text. Add .dark to an ancestor (usually <html>) to select the built-in dark defaults; there is no theme manager, local-storage behavior, or JavaScript theme dependency.
Copy a theme into app.css
Put overrides after your imports. With Tailwind v4, use semantic variables via @theme, just like other Tailwind colors. UI maps these to its own tokens; you do not need to edit the published ui.css.
Purple (white text on a dark accent):
@theme {
--color-accent: var(--color-purple-700);
--color-accent-content: var(--color-purple-700);
--color-accent-foreground: var(--color-white);
}
@layer theme {
.dark {
--color-accent: var(--color-purple-300);
--color-accent-content: var(--color-purple-300);
--color-accent-foreground: var(--color-gray-950);
}
}Teal: use the same block with purple-700 changed to teal-700 and purple-300 changed to teal-300. For blue, use blue-700 / blue-300. Dark variants use a light accent with dark button text. Avoid swapping only the background for an arbitrary light color while keeping white text.
Neutral surfaces have their own semantic tokens, so change the entire kit without remapping Tailwind's global gray palette:
@theme {
--color-ui-surface: var(--color-gray-50);
--color-ui-text: var(--color-gray-950);
--color-ui-muted: var(--color-gray-600);
--color-ui-border: var(--color-gray-200);
--color-ui-border-strong: var(--color-gray-300);
}
@layer theme {
.dark {
--color-ui-surface: var(--color-gray-950);
--color-ui-text: var(--color-gray-50);
--color-ui-muted: var(--color-gray-300);
--color-ui-border: var(--color-gray-800);
--color-ui-border-strong: var(--color-gray-700);
}
}Without Tailwind, use standard CSS variables instead of @theme:
:root {
--color-accent: #7e22ce;
--color-accent-content: #7e22ce;
--color-accent-foreground: #fff;
}
.dark {
--color-accent: #d8b4fe;
--color-accent-content: #d8b4fe;
--color-accent-foreground: #030712;
}Both paths only change CSS variables. Check contrast again when introducing your own colors, hover styles, or backgrounds; opacity on disabled controls is intentional.
Complete Example
The runnable sample is /ui in SampleApp:
app/Live/UiForm.cs: name/bio/visibility validation and a boolean preference.Savevalidates without writing to a database.resources/views/live/ui-form.blade.html: the form components including a multiple combobox bound to a list, accessible descriptions/errors, loading and disabled buttons.resources/views/home/Ui.blade.html: demo page using the app layout, including a Custom classes section that overrides and combines kit styles with utility classes and part attributes.routes/web.csandHomeController: GET/ui, namedui.resources/views/live/post-form.blade.html: integration into the existing post creation form, preserving its ordinary POST action and CSRF token.
With the .NET 10 SDK and sample setup available, run these commands from samples/SampleApp:
npm install
npm run build
dotblaze serveIf the CLI tool is not installed, use dotnet run as the sample's direct CLI fallback. Open /ui on the URL printed by the server; it needs no sign-in. Submit an empty name to see a linked validation error. Enter a name, change visibility and toggle updates, then submit again: all values remain and the status says Validated. This demo does not save data. The interactive demo requires JavaScript; the controls themselves also work in ordinary HTML forms.
Verification
From the repository root:
dotnet test tests/SampleApp.Tests --filter "FullyQualifiedName~Ui"This checks compiled Blade rendering, safe encoding, attribute forwarding, conditional booleans, and real HTTP Live updates including rejected visibility and language values.
With SampleApp running (default browser-test URL http://127.0.0.1:5077):
cd tests/Browser
npm install
npx playwright install chromium
node ui.e2e.js
node ui.combobox.e2e.jsSet BASE_URL if your server uses a different URL. The Playwright test checks labels, description/error associations, keyboard interaction, focus after DOM updates, loading text, disabled-state restoration, CSS loading, and control values through real server responses. ui.combobox.e2e.js covers the combobox: the native fallback with JavaScript disabled, label focus and ARIA wiring, search and keyboard selection, single and multiple modes, Enter not submitting the form, and Live round trips, validation, and morphs while it is open. ui.e2e.js also checks that utility classes and part attributes override the kit styles in the built CSS. Both are included in npm test and the existing browser CI job. This is not a complete screen-reader or cross-browser accessibility audit.
Complete-catalog verification
tests/Browser/ui.complete.e2e.js exercises overlays, keyboard focus/dismissal, calendar selection, pillbox escaping, native inputs, WYSIWYG Markdown editing, composer submission, kanban moves, and chart data against the running app. Calendar, pillbox, and editor also run through two actual Live updates in UiAdvancedForm. UiCompleteTest checks server rendering and unsafe pagination URL rejection. These are Chromium checks, not a full screen-reader or cross-browser accessibility audit.
The catalog screenshots show overlays inline for documentation framing so their contents are visible; runtime modal/popover positioning and focus behavior are exercised separately in E2E. The color picker and emoji flags still depend on the browser/OS; date/time pickers use Flatpickr rather than native popups.
tests/Browser/ui.widgets.e2e.js verifies WYSIWYG formatting/sanitization/readonly, custom picker bounds/values, multiseries line and stacked bars, theme updates, actual pointer drag between kanban columns, keyboard reorder, and library cleanup during navigation.