Target · C# / .NET
Using TUX in .NET & ASP.NET
Consume TUX tokens, Tag Helpers, and Blazor components in .NET 8/9 and legacy ASP.NET MVC applications.
1. ASP.NET Core Razor Pages & MVC
Install the Razor Tag Helper package from Forgejo NuGet:
terminal
dotnet add package Tti.Tux.AspNetCore --source https://code.tti.tamu.edu/api/packages/tti/nuget/index.json Add @addTagHelper *, Tti.Tux.AspNetCore to your _ViewImports.cshtml and author views with native tags:
Index.cshtml
@addTagHelper *, Tti.Tux.AspNetCore
<tux-page-header eyebrow="Research Center" title="Connected Infrastructure">
<tux-button intent="Primary" asp-action="Export">Export Data</tux-button>
</tux-page-header>
<div class="row">
<div class="col-md-4">
<tux-card>
<tux-big-stat value="93.4" suffix="%" label="Classifier Precision" tone="maroon" />
</tux-card>
</div>
</div>2. Blazor (Server & WebAssembly)
Install the Blazor Razor Class Library (RCL):
terminal
dotnet add package Tti.Tux.Blazor --source https://code.tti.tamu.edu/api/packages/tti/nuget/index.json Use typed Blazor components in .razor pages:
Dashboard.razor
@using Tti.Tux.Blazor
<TuxCard To="/reports" Padded="true">
<TuxBigStat Value="126" Suffix="M" Label="Annual research expenditure" Tone="maroon" />
</TuxCard>3. C# Design Token Constants
For WPF, MAUI, PDF generators, or background services without HTML, consume TuxTokens.cs:
ReportGenerator.cs
using Tti.Tux;
// Direct literal access in C# code, reports, or WPF/MAUI:
string maroonHex = TuxTokens.Tti.BrandPrimary; // "#500000"
string goldHex = TuxTokens.Tti.BrandAccent; // "#C59B27"