Blazix.Primitives 0.7.0

dotnet add package Blazix.Primitives --version 0.7.0
                    
NuGet\Install-Package Blazix.Primitives -Version 0.7.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Blazix.Primitives" Version="0.7.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Blazix.Primitives" Version="0.7.0" />
                    
Directory.Packages.props
<PackageReference Include="Blazix.Primitives" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Blazix.Primitives --version 0.7.0
                    
#r "nuget: Blazix.Primitives, 0.7.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Blazix.Primitives@0.7.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Blazix.Primitives&version=0.7.0
                    
Install as a Cake Addin
#tool nuget:?package=Blazix.Primitives&version=0.7.0
                    
Install as a Cake Tool

Blazix.Primitives

Unstyled Blazor primitives. You bring the CSS.

They follow the WAI-ARIA Authoring Practices, but they haven't been tested with screen readers or audited. If your project needs to be accessible, test it yourself.

dotnet add package Blazix.Primitives
@using Blazix.Primitives

<MenuRoot>
    <MenuTrigger class="button">Song</MenuTrigger>
    <MenuPopup class="menu" SideOffset="4">
        <MenuItem class="item" OnClick="AddToLibrary">Add to library</MenuItem>
        <MenuSubmenuRoot>
            <MenuSubmenuTrigger class="item">Add to playlist</MenuSubmenuTrigger>
            <MenuPopup class="menu">
                <MenuItem class="item">Get Up!</MenuItem>
            </MenuPopup>
        </MenuSubmenuRoot>
        <MenuSeparator class="separator" />
        <MenuCheckboxItem class="item" @bind-Checked="shuffle">
            <MenuCheckboxItemIndicator>✓</MenuCheckboxItemIndicator> Shuffle
        </MenuCheckboxItem>
    </MenuPopup>
</MenuRoot>

Accordion, Alert Dialog, Autocomplete, Avatar, Button, Checkbox, Checkbox Group, Collapsible, Combobox, Context Menu, Dialog, Drawer, Field, Fieldset, Form, Input, Menu, Menubar, Meter, Navigation Menu, Number Field, OTP Field, Popover, Preview Card, Progress, Radio, Radio Group, Scroll Area, Select, Separator, Slider, Switch, Tabs, Toast, Toggle, Toggle Group, Toolbar and Tooltip, each split into parts (DialogRoot, DialogTrigger, DialogPortal, DialogBackdrop, DialogPopup...). Plus the utilities: CspProvider, DirectionProvider, UseRender (useRender), AttributeBuilder (mergeProps) and MediaQuery. Also a headless Questionnaire, with its parts (QuestionnaireRoot, QuestionnaireItem, QuestionnaireChoice...).

  • Needs an interactive render mode: Interactive Server or WebAssembly.
  • Trimmable and AOT-compatible (IsAotCompatible, with no trim or AOT warnings), so it works in trimmed WebAssembly apps and with WebAssembly AOT.
  • No <script> tag: each component's JS module ships in this package and is imported on first use.
  • WAI-ARIA patterns and keyboard behaviour: roles and states, roving focus, typeahead, focus trapping and return, and dismissal by Escape, outside press and Tab.
  • State lives in Blazor, including what JS tracks, such as the highlighted menu item (props.Highlighted). Focus follows Blazor's changes: a removed item hands focus to its neighbour, and closing or disabling from code returns focus to the trigger.
  • Enter/exit animations: a closing popup stays mounted with data-closed + data-ending-style until your CSS animation or transition finishes, and data-starting-style marks the first frame on open (except for a popup that's already open on its first render, which appears as it is).
  • Popups render in the browser's top layer (Popover API), so they aren't clipped by overflow: hidden, yet they stay where you wrote them in the DOM, so CSS isolation and theme classes apply.

Styling contract

The parts render data attributes and CSS variables to style against. The common ones:

Hook Meaning
data-open / data-closed open state of a popup, panel or its trigger
data-popup-open on a trigger while its popup is open
data-starting-style / data-ending-style where enter transitions start, and where exit transitions go
data-highlighted, data-disabled, data-checked / data-unchecked item and control state
data-side, data-align a popup's final placement
--anchor-width, --anchor-height, --available-width, --available-height, --transform-origin layout helpers on popups

Render your own elements (render, asChild)

Every element-rendering part takes a Render fragment. Spread props.Attributes onto your element or component:

<MenuItem OnClick="Track">
    <Render Context="item">
        <a @attributes="item.Attributes" href="/settings">Settings</a>
    </Render>
</MenuItem>

Attributes you put on the part are merged in: your handlers run before the part's, and your style comes after the part's. A trigger rendered as something other than a <button> is detected and gets role="button", a tab stop and Enter/Space. You only set NativeButton to skip that check.

Want pre-styled components instead? dnx Blazix.Cli add dropdown-menu copies Tailwind-styled wrappers into your project.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.7.0 0 12/5/2026
0.6.2 0 12/4/2026
0.6.1 10 12/4/2026
0.6.0 49 12/4/2026
0.5.0 83 12/1/2026
0.4.0 103 11/26/2026
0.3.0 103 11/22/2026
0.2.2 92 11/22/2026
0.2.1 86 11/22/2026
0.2.0 87 11/22/2026
0.1.0 107 11/21/2026